'files --> use with open(file_name)!'
-class IterativeReader:
+class IterativeReader(object):
""" reads from a given file
Uses os.stat(file_obj.fileno()).st_size as measure whether file has changed
self.line_buffers[idx] = ''
result = []
should_be_no_new_lines = False
- for line in all_data.splitlines(keepends=True):
+ for line in all_data.splitlines(True):
if line[-1] in LINE_SPLITTERS:
result.append((description, line.rstrip(LINE_SPLITTERS)))
elif should_be_no_new_lines:
just checks whether given var is subclass of io.IOBase, which is also True
for 'file-like objects' like StringIO
"""
- return isinstance(var, IOBase)
+ return isinstance(var, IOBase) or (PY2 and isinstance(var, file))
def main():