diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/tempfile.rst | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst index e38dbab..cc3318f 100644 --- a/Doc/library/tempfile.rst +++ b/Doc/library/tempfile.rst @@ -51,7 +51,8 @@ The module defines the following user-callable functions: The returned object is a true file object on POSIX platforms. On other platforms, it is a file-like object whose :attr:`file` attribute is the - underlying true file object. + underlying true file object. This file-like object can be used in a :keyword:`with` + statement, just like a normal file. .. function:: NamedTemporaryFile([mode='w+b'[, bufsize=-1[, suffix[, prefix[, dir[, delete]]]]]]) @@ -64,7 +65,8 @@ The module defines the following user-callable functions: across platforms (it can be so used on Unix; it cannot on Windows NT or later). If *delete* is true (the default), the file is deleted as soon as it is closed. The returned object is always a file-like object whose :attr:`file` attribute - is the underlying true file object. + is the underlying true file object. This file-like object can be used in a :keyword:`with` + statement, just like a normal file. .. function:: SpooledTemporaryFile([max_size=0, [mode='w+b'[, bufsize=-1[, suffix[, prefix[, dir]]]]]]) @@ -79,7 +81,8 @@ The module defines the following user-callable functions: The returned object is a file-like object whose :attr:`_file` attribute is either a :class:`StringIO` object or a true file object, depending on - whether :func:`rollover` has been called. + whether :func:`rollover` has been called. This file-like object can be used in a + :keyword:`with` statement, just like a normal file. .. function:: mkstemp([suffix[, prefix[, dir[, text]]]]) |