summaryrefslogtreecommitdiffstats
path: root/Doc/library/functools.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2023-04-22 01:53:50 (GMT)
committerGitHub <noreply@github.com>2023-04-22 01:53:50 (GMT)
commit7d20783d45a9c78379fe79229b57e4c31610a623 (patch)
treea5cbd4a4aafed80e2d94b05fabbf460a875989b7 /Doc/library/functools.rst
parent0cb0871584d2288e436445ee32e585bf5af7c9de (diff)
downloadcpython-7d20783d45a9c78379fe79229b57e4c31610a623.zip
cpython-7d20783d45a9c78379fe79229b57e4c31610a623.tar.gz
cpython-7d20783d45a9c78379fe79229b57e4c31610a623.tar.bz2
Minor improvements to the functools docs (#103672)
* Use an f-string for improved readability * Put version notes in chronological order
Diffstat (limited to 'Doc/library/functools.rst')
-rw-r--r--Doc/library/functools.rst5
1 files changed, 2 insertions, 3 deletions
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index d467e50..d1289ce 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -118,6 +118,7 @@ The :mod:`functools` module defines the following functions:
def stdev(self):
return statistics.stdev(self._data)
+ .. versionadded:: 3.8
.. versionchanged:: 3.12
Prior to Python 3.12, ``cached_property`` included an undocumented lock to
@@ -126,8 +127,6 @@ The :mod:`functools` module defines the following functions:
per-instance, which could result in unacceptably high lock contention. In
Python 3.12+ this locking is removed.
- .. versionadded:: 3.8
-
.. function:: cmp_to_key(func)
@@ -233,7 +232,7 @@ The :mod:`functools` module defines the following functions:
@lru_cache(maxsize=32)
def get_pep(num):
'Retrieve text of a Python Enhancement Proposal'
- resource = 'https://peps.python.org/pep-%04d/' % num
+ resource = f'https://peps.python.org/pep-{num:04d}'
try:
with urllib.request.urlopen(resource) as s:
return s.read()