def __init__(self, f):
if isinstance(f, str):<EOL><INDENT>self.filename = f<EOL>self.f = open(f)<EOL>self._auto_close = True<EOL><DEDENT>else:<EOL><INDENT>self.f = f<EOL>self._auto_close = False<EOL><DEDENT>
Argument:
 | ``f``  --  a filename or a file-like object