[Python-Dev] tempfile.TemporaryFile on Windows NT

Tim Peters tim.peters at gmail.com
Thu Sep 16 04:34:58 CEST 2004


[Martin v. Löwis]
> Ah, ok. This is probably the time to present my case: Somebody
> complained on c.l.p that isinstance(tempfile.TemporaryFile(), file)
> gives True on Linux but False on Windows. While this result is
> "in principle correct", I think something can be done to make it
> correct practically, too.

I'm not going to object, but writing "isinstance(..., file)" is almost
never a *practical* thing to do in Python code anyway, so I don't
personally see the attraction.  Since tons of file-like objects aren't
instances of __builtin__.file, and it doesn't make a lick of
difference that they aren't, "isinstance(..., file)" isn't in the
practical Pythoneer's vocabulary.  That doesn't mean you can't want
this change for inscrutable reasons, though <wink>.


More information about the Python-Dev mailing list