[Python-checkins] cpython (merge 3.3 -> default): #14515: clarify that TemporaryDirectory's __enter__ returns the name.
r.david.murray
python-checkins at python.org
Wed Feb 5 20:56:53 CET 2014
http://hg.python.org/cpython/rev/7b7e17723787
changeset: 88978:7b7e17723787
parent: 88975:077aa6d4f3b7
parent: 88977:b5fe07d39e16
user: R David Murray <rdmurray at bitdance.com>
date: Wed Feb 05 14:56:39 2014 -0500
summary:
#14515: clarify that TemporaryDirectory's __enter__ returns the name.
files:
Doc/library/tempfile.rst | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst
--- a/Doc/library/tempfile.rst
+++ b/Doc/library/tempfile.rst
@@ -97,12 +97,14 @@
This function creates a temporary directory using :func:`mkdtemp`
(the supplied arguments are passed directly to the underlying function).
The resulting object can be used as a context manager (see
- :ref:`context-managers`). On completion of the context (or destruction
- of the temporary directory object), the newly created temporary directory
+ :ref:`context-managers`). On completion of the context or destruction
+ of the temporary directory object the newly created temporary directory
and all its contents are removed from the filesystem.
- The directory name can be retrieved from the :attr:`name` attribute
- of the returned object.
+ The directory name can be retrieved from the :attr:`name` attribute of the
+ returned object. When the returned object is used as a context manager, the
+ :attr:`name` will be assigned to the target of the :keyword:`as` clause in
+ the :keyword:`with` statement, if there is one.
The directory can be explicitly cleaned up by calling the
:func:`cleanup` method.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list