PEP for fp.type()

Martin von Loewis loewis at informatik.hu-berlin.de
Wed Jan 16 10:04:54 CET 2002


"Andrew Dalke" <dalke at dalkescientific.com> 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.

Regards,
Martin



More information about the Python-list mailing list