Guido> Have we documented the alternatives well enough?
I suppose we could document explicitly how to use mkstemp() in place of
mktemp(), but the difference in return value is fairly modest:
>>> tempfile.mktemp()
'/var/folders/5q/5qTPn6xq2RaWqk+1Ytw3-U+++TI/-Tmp-/tmpV_5OLi'
>>> tempfile.mkstemp()
(3, '/var/folders/5q/5qTPn6xq2RaWqk+1Ytw3-U+++TI/-Tmp-/tmpmS7K4T')
and the argument list is quite similar as well:
>>> help(tempfile.mktemp)
Help on function mktemp in module tempfile:
mktemp(suffix='', prefix='tmp', dir=None)
...
>>> help(tempfile.mkstemp)
Help on function mkstemp in module tempfile:
mkstemp(suffix='', prefix='tmp', dir=None, text=False)
...
Guido> In most cases NamedTemporaryFile will work, ...
It's API seems to be a bit farther from the mktemp API than that of mkstemp.
Skip
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com