]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Minor improvements to the functools docs (#103672)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Sat, 22 Apr 2023 01:53:50 +0000 (20:53 -0500)
committerGitHub <noreply@github.com>
Sat, 22 Apr 2023 01:53:50 +0000 (20:53 -0500)
* Use an f-string for improved readability

* Put version notes in chronological order

Doc/library/functools.rst

index d467e50bc7a424c5711c38155c043ff553c10f03..d1289ce836210a4acc325c016b04fe37041fa824 100644 (file)
@@ -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()