Skip to content

Commit 7d20783

Browse files
authored
Minor improvements to the functools docs (#103672)
* Use an f-string for improved readability * Put version notes in chronological order
1 parent 0cb0871 commit 7d20783

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Doc/library/functools.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ The :mod:`functools` module defines the following functions:
118118
def stdev(self):
119119
return statistics.stdev(self._data)
120120

121+
.. versionadded:: 3.8
121122

122123
.. versionchanged:: 3.12
123124
Prior to Python 3.12, ``cached_property`` included an undocumented lock to
@@ -126,8 +127,6 @@ The :mod:`functools` module defines the following functions:
126127
per-instance, which could result in unacceptably high lock contention. In
127128
Python 3.12+ this locking is removed.
128129

129-
.. versionadded:: 3.8
130-
131130

132131
.. function:: cmp_to_key(func)
133132

@@ -233,7 +232,7 @@ The :mod:`functools` module defines the following functions:
233232
@lru_cache(maxsize=32)
234233
def get_pep(num):
235234
'Retrieve text of a Python Enhancement Proposal'
236-
resource = 'https://peps.python.org/pep-%04d/' % num
235+
resource = f'https://peps.python.org/pep-{num:04d}'
237236
try:
238237
with urllib.request.urlopen(resource) as s:
239238
return s.read()

0 commit comments

Comments
 (0)