fsspec/core.py
def open(self):
        """Materialise this as a real open file without context

        The file should be explicitly closed to avoid enclosed file
        instances persisting. This code-path monkey-patches the file-like
        objects, so they can close even if the parent OpenFile object has already
        been deleted; but a with-context is better style.
        """
        out = self.__enter__()
        closer = out.close
        fobjects = self.fobjects.copy()[:-1]
        mode = self.mode

        def close():
            # this func has no reference to
            closer()  # original close bound method of the final file-like
            _close(fobjects, mode)  # call close on other dependent file-likes

        out.close = close
        return out
Materialise this as a real open file without context

        The file should be explicitly closed to avoid enclosed file
        instances persisting. This code-path monkey-patches the file-like
        objects, so they can close even if the parent OpenFile object has already
        been deleted; but a with-context is better style.
        
Materialise this as a real open file without context
The file should be explicitly closed to avoid enclosed file
instances persisting. This code-path monkey-patches the file-like
objects, so they can close even if the parent OpenFile object has already
been deleted; but a with-context is better style.
Materialise this as a real open file without context The file should be explicitly closed to avoid enclosed file instances persisting . This code - path monkey - patches the file - like objects so they can close even if the parent OpenFile object has already been deleted ; but a with - context is better style .
def open(self):
        out = self.__enter__()
        closer = out.close
        fobjects = self.fobjects.copy()[:-1]
        mode = self.mode
        def close():
            closer()  
            _close(fobjects, mode)  
        out.close = close
        return out
def open ( self ) : out = self . __enter__ ( ) closer = out . close fobjects = self . fobjects . copy ( ) [ : - 1 ] mode = self . mode def close ( ) : closer ( ) _close ( fobjects , mode ) out . close = close return out
Materialise this as a real open file without context
The file should be explicitly closed to avoid enclosed file
instances persisting.
Materialise this as a real open file without context The file should be explicitly closed to avoid enclosed file instances persisting .
"""Materialise this as a real open file without context

        The file should be explicitly closed to avoid enclosed file
        instances persisting. This code-path monkey-patches the file-like
        objects, so they can close even if the parent OpenFile object has already
        been deleted; but a with-context is better style.
        """ # this func has no reference to # original close bound method of the final file-like # call close on other dependent file-likes
self