Skip to content

Commit 7daf7fd

Browse files
sirosenencukou
andauthored
Apply batched suggestions from code review
Co-authored-by: Petr Viktorin <encukou@gmail.com>
1 parent db8ab2d commit 7daf7fd

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎Doc/library/tempfile.rst‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,19 @@ The module defines the following user-callable items:
3333
.. function:: TemporaryFile(mode='w+b', buffering=-1, encoding=None, newline=None, suffix=None, prefix=None, dir=None, *, errors=None)
3434

3535
Return a :term:`file-like object` that can be used as a temporary storage area.
36-
The file is created securely, using the same rules as :func:`mkstemp`,
37-
and the object can be used as a context manager
36+
The file is created securely, using the same rules as :func:`mkstemp`.
37+
38+
The object can be used as a context manager
3839
(see :ref:`tempfile-examples`).
40+
Exiting the context manager closes the file.
3941

4042
Under Unix, the directory entry for the file is either not created at all or is
4143
removed immediately after the file is created. Other platforms do not support
4244
this; your code should not rely on a temporary file created using this
4345
function having or not having a visible name in the file system.
4446

45-
The file will be removed from the file system when the object is closed or
46-
garbage collected (and implicitly closed). Exiting the context manager
47-
closes the file.
47+
The file will be removed from the file system when the object is closed
48+
(including an implicit close when the object is garbage collected).
4849

4950
The *mode* parameter defaults to ``'w+b'`` so that the file created can
5051
be read and written without being closed. Binary mode is used so that it

0 commit comments

Comments
 (0)