[Python-Dev] Rationale for NamedTemporaryFile?

Georg Brandl g.brandl at gmx.net
Wed Mar 21 12:39:02 CET 2007

Greg Ewing schrieb:
> Scott Dial wrote:
>> Greg Ewing wrote:
>>> Maybe instead of an option there should be a separate
>>> function with a different name, such as NewUniqueFile.
>> I'm in favor of adding such a function.
> A tangential question -- why are TemporaryFile and
> NamedTemporaryFile named in TitleCase, when they're
> functions and not classes?

Probably because they are factory functions potentially returning a
_TemporaryFileWrapper. If they were "functions", they'd have to be
verbed, e.g. "make_temporary_file()".

The class/function distinction is not so clear in Python from the user's
point of view since there is no different calling syntax.


More information about the Python-Dev mailing list