PEP for fp.type()

Martin von Loewis loewis at
Wed Jan 16 04:04:54 EST 2002

"Andrew Dalke" <dalke at> writes:

> It's easier to have a module then pass it the filehandle or filename.

Actually, I'd only allow to pass it file names. Finding the type of an
open file is inherently hard (e.g. if it was opened in text mode,
looking for the Python bytecode magic will fail), and the application
should be encouraged to pass the file name if it can.


More information about the Python-list mailing list