[issue22387] Making tempfile.NamedTemporaryFile a class

Serhiy Storchaka report at bugs.python.org
Thu Sep 11 14:19:39 CEST 2014


Serhiy Storchaka added the comment:

You can do this with a function too:

    def NTF(*args, closed=False, **kwargs):
        if closed: kwargs["delete"] = True
        ntf = NamedTemporaryFile(*args, **kwargs)
        if closed: ntf.close()
        return ntf

----------
nosy: +georg.brandl, ncoghlan, serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22387>
_______________________________________


More information about the Python-bugs-list mailing list