Proposed extension to file constructor

Skip Montanaro skip at
Tue Jun 3 21:40:28 CEST 2003

    taral> I needed to extend popen functionality, so I modified the file
    taral> constructor to optionally take a file descriptor. It was, in my
    taral> opinion, the minimum way to do it while preserving isinstance(x,
    taral> file).

Where are you getting file descriptors?  What's wrong with using os.fdopen
to wrap a file descriptor in a file object?

        fdopen(fd [, mode='r' [, bufsize]]) -> file_object

        Return an open file object connected to a file descriptor.


More information about the Python-list mailing list