Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3a420c7

Browse files
committed
#10354: remove last public mentions of 'template' and comment as private.
I didn't rename the variable because I can see no good reason to break backward compatibility just to put an underscore in the name.
1 parent 8153b7a commit 3a420c7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/library/tempfile.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ instead a string of six random characters is used.
2525

2626
Also, all the user-callable functions now take additional arguments which
2727
allow direct control over the location and name of temporary files. It is
28-
no longer necessary to use the global *tempdir* and *template* variables.
28+
no longer necessary to use the global *tempdir* variable.
2929
To maintain backward compatibility, the argument order is somewhat odd; it
3030
is recommended to use keyword arguments for clarity.
3131

Lib/tempfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
1111
TMP_MAX - maximum number of names that will be tried before
1212
giving up.
13-
template - the default prefix for all temporary names.
14-
You may change this to control the default prefix.
1513
tempdir - If this is set to a string before the first use of
1614
any routine from this module, it will be considered as
1715
another candidate location to store temporary files.
@@ -74,6 +72,8 @@ def _set_cloexec(fd):
7472
else:
7573
TMP_MAX = 10000
7674

75+
# Although it does not have an underscore for historical reasons, this
76+
# variable is an internal implementation detail (see issue 10354).
7777
template = "tmp"
7878

7979
# Internal routines.

0 commit comments

Comments
 (0)