]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Correctly document class instead of function (GH-32016)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 23 Mar 2022 16:17:53 +0000 (09:17 -0700)
committerGitHub <noreply@github.com>
Wed, 23 Mar 2022 16:17:53 +0000 (09:17 -0700)
(cherry picked from commit 624e3986fbf8467772e4863b7ec004e65adff619)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
Doc/library/tempfile.rst

index 6b23a1bcd630bc9bfeb8dadc1eeafbb2d81a7ece..30491d48e10ef0dce4d9036442c5c63182403c84 100644 (file)
@@ -96,9 +96,9 @@ The module defines the following user-callable items:
       Added *errors* parameter.
 
 
-.. function:: SpooledTemporaryFile(max_size=0, mode='w+b', buffering=-1, encoding=None, newline=None, suffix=None, prefix=None, dir=None, *, errors=None)
+.. class:: SpooledTemporaryFile(max_size=0, mode='w+b', buffering=-1, encoding=None, newline=None, suffix=None, prefix=None, dir=None, *, errors=None)
 
-   This function operates exactly as :func:`TemporaryFile` does, except that
+   This class operates exactly as :func:`TemporaryFile` does, except that
    data is spooled in memory until the file size exceeds *max_size*, or
    until the file's :func:`fileno` method is called, at which point the
    contents are written to disk and operation proceeds as with
@@ -121,9 +121,9 @@ The module defines the following user-callable items:
       Added *errors* parameter.
 
 
-.. function:: TemporaryDirectory(suffix=None, prefix=None, dir=None, ignore_cleanup_errors=False)
+.. class:: TemporaryDirectory(suffix=None, prefix=None, dir=None, ignore_cleanup_errors=False)
 
-   This function securely creates a temporary directory using the same rules as :func:`mkdtemp`.
+   This class securely creates a temporary directory using the same rules as :func:`mkdtemp`.
    The resulting object can be used as a context manager (see
    :ref:`tempfile-examples`).  On completion of the context or destruction
    of the temporary directory object, the newly created temporary directory