Skip to content

Commit eb94a04

Browse files
erlend-aaslandCAM-Gerlachezio-melotti
authored
[3.11] Docs: align usage of versionadded/versionchanged with recommended practice (#114409) (#114473)
(cherry picked from commit 1d7bddd) Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Ezio Melotti <[email protected]>
1 parent 1f04ac8 commit eb94a04

25 files changed

+156
-157
lines changed

Doc/library/argparse.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,8 +1923,8 @@ FileType objects
19231923
>>> parser.parse_args(['-'])
19241924
Namespace(infile=<_io.TextIOWrapper name='<stdin>' encoding='UTF-8'>)
19251925

1926-
.. versionadded:: 3.4
1927-
The *encodings* and *errors* keyword arguments.
1926+
.. versionchanged:: 3.4
1927+
Added the *encodings* and *errors* parameters.
19281928

19291929

19301930
Argument groups

Doc/library/asyncio-stream.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ and work with streams:
7777
.. versionchanged:: 3.7
7878
Added the *ssl_handshake_timeout* parameter.
7979

80-
.. versionadded:: 3.8
81-
Added *happy_eyeballs_delay* and *interleave* parameters.
80+
.. versionchanged:: 3.8
81+
Added the *happy_eyeballs_delay* and *interleave* parameters.
8282

8383
.. versionchanged:: 3.10
8484
Removed the *loop* parameter.

Doc/library/bdb.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ The :mod:`bdb` module also defines two classes:
132132
frame is considered to originate in a certain module is determined
133133
by the ``__name__`` in the frame globals.
134134

135-
.. versionadded:: 3.1
136-
The *skip* argument.
135+
.. versionchanged:: 3.1
136+
Added the *skip* parameter.
137137

138138
The following methods of :class:`Bdb` normally don't need to be overridden.
139139

Doc/library/concurrent.futures.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ And::
171171
should be higher than the number of workers
172172
for :class:`ProcessPoolExecutor`.
173173

174-
.. versionadded:: 3.6
175-
The *thread_name_prefix* argument was added to allow users to
174+
.. versionchanged:: 3.6
175+
Added the *thread_name_prefix* parameter to allow users to
176176
control the :class:`threading.Thread` names for worker threads created by
177177
the pool for easier debugging.
178178

Doc/library/configparser.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,14 +1045,14 @@ ConfigParser Objects
10451045
config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],
10461046
encoding='cp1250')
10471047

1048-
.. versionadded:: 3.2
1049-
The *encoding* parameter. Previously, all files were read using the
1050-
default encoding for :func:`open`.
1048+
.. versionchanged:: 3.2
1049+
Added the *encoding* parameter.
1050+
Previously, all files were read using the default encoding for :func:`open`.
10511051

1052-
.. versionadded:: 3.6.1
1052+
.. versionchanged:: 3.6.1
10531053
The *filenames* parameter accepts a :term:`path-like object`.
10541054

1055-
.. versionadded:: 3.7
1055+
.. versionchanged:: 3.7
10561056
The *filenames* parameter accepts a :class:`bytes` object.
10571057

10581058

@@ -1313,9 +1313,9 @@ Exceptions
13131313
that is already present or in strict parsers when a section if found more
13141314
than once in a single input file, string or dictionary.
13151315

1316-
.. versionadded:: 3.2
1317-
Optional ``source`` and ``lineno`` attributes and arguments to
1318-
:meth:`!__init__` were added.
1316+
.. versionchanged:: 3.2
1317+
Added the optional *source* and *lineno* attributes and parameters to
1318+
:meth:`!__init__`.
13191319

13201320

13211321
.. exception:: DuplicateOptionError

Doc/library/datetime.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,8 @@ Constructor:
855855

856856
If an argument outside those ranges is given, :exc:`ValueError` is raised.
857857

858-
.. versionadded:: 3.6
859-
Added the ``fold`` argument.
858+
.. versionchanged:: 3.6
859+
Added the *fold* parameter.
860860

861861
Other constructors, all class methods:
862862

@@ -1244,8 +1244,8 @@ Instance methods:
12441244
``tzinfo=None`` can be specified to create a naive datetime from an aware
12451245
datetime with no conversion of date and time data.
12461246

1247-
.. versionadded:: 3.6
1248-
Added the ``fold`` argument.
1247+
.. versionchanged:: 3.6
1248+
Added the *fold* parameter.
12491249

12501250

12511251
.. method:: datetime.astimezone(tz=None)
@@ -1488,8 +1488,8 @@ Instance methods:
14881488
>>> dt.isoformat(timespec='microseconds')
14891489
'2015-01-01T12:30:59.000000'
14901490

1491-
.. versionadded:: 3.6
1492-
Added the *timespec* argument.
1491+
.. versionchanged:: 3.6
1492+
Added the *timespec* parameter.
14931493

14941494

14951495
.. method:: datetime.__str__()
@@ -1822,8 +1822,8 @@ Instance methods:
18221822
``tzinfo=None`` can be specified to create a naive :class:`.time` from an
18231823
aware :class:`.time`, without conversion of the time data.
18241824

1825-
.. versionadded:: 3.6
1826-
Added the ``fold`` argument.
1825+
.. versionchanged:: 3.6
1826+
Added the *fold* parameter.
18271827

18281828

18291829
.. method:: time.isoformat(timespec='auto')
@@ -1866,8 +1866,8 @@ Instance methods:
18661866
>>> dt.isoformat(timespec='auto')
18671867
'12:34:56'
18681868

1869-
.. versionadded:: 3.6
1870-
Added the *timespec* argument.
1869+
.. versionchanged:: 3.6
1870+
Added the *timespec* parameter.
18711871

18721872

18731873
.. method:: time.__str__()

Doc/library/difflib.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
5252
the purpose of sequence matching. This heuristic can be turned off by setting
5353
the ``autojunk`` argument to ``False`` when creating the :class:`SequenceMatcher`.
5454

55-
.. versionadded:: 3.2
56-
The *autojunk* parameter.
55+
.. versionchanged:: 3.2
56+
Added the *autojunk* parameter.
5757

5858

5959
.. class:: Differ
@@ -387,8 +387,8 @@ The :class:`SequenceMatcher` class has this constructor:
387387
The optional argument *autojunk* can be used to disable the automatic junk
388388
heuristic.
389389

390-
.. versionadded:: 3.2
391-
The *autojunk* parameter.
390+
.. versionchanged:: 3.2
391+
Added the *autojunk* parameter.
392392

393393
SequenceMatcher objects get three data attributes: *bjunk* is the
394394
set of elements of *b* for which *isjunk* is ``True``; *bpopular* is the set of

Doc/library/email.policy.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ added matters. To illustrate::
218218
Default: :const:`False`.
219219

220220
.. versionadded:: 3.5
221-
The *mangle_from_* parameter.
222221

223222

224223
.. attribute:: message_factory

Doc/library/functions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,8 +1072,8 @@ are always available. They are listed here in alphabetical order.
10721072
such as ``sorted(iterable, key=keyfunc, reverse=True)[0]`` and
10731073
``heapq.nlargest(1, iterable, key=keyfunc)``.
10741074

1075-
.. versionadded:: 3.4
1076-
The *default* keyword-only argument.
1075+
.. versionchanged:: 3.4
1076+
Added the *default* keyword-only parameter.
10771077

10781078
.. versionchanged:: 3.8
10791079
The *key* can be ``None``.
@@ -1110,8 +1110,8 @@ are always available. They are listed here in alphabetical order.
11101110
such as ``sorted(iterable, key=keyfunc)[0]`` and ``heapq.nsmallest(1,
11111111
iterable, key=keyfunc)``.
11121112

1113-
.. versionadded:: 3.4
1114-
The *default* keyword-only argument.
1113+
.. versionchanged:: 3.4
1114+
Added the *default* keyword-only parameter.
11151115

11161116
.. versionchanged:: 3.8
11171117
The *key* can be ``None``.

Doc/library/functools.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ The :mod:`functools` module defines the following functions:
179179
In contrast, the tuple arguments ``('answer', Decimal(42))`` and
180180
``('answer', Fraction(42))`` are treated as equivalent.
181181

182-
The wrapped function is instrumented with a :func:`cache_parameters`
182+
The wrapped function is instrumented with a :func:`!cache_parameters`
183183
function that returns a new :class:`dict` showing the values for *maxsize*
184184
and *typed*. This is for information purposes only. Mutating the values
185185
has no effect.
@@ -260,8 +260,8 @@ The :mod:`functools` module defines the following functions:
260260
.. versionchanged:: 3.8
261261
Added the *user_function* option.
262262

263-
.. versionadded:: 3.9
264-
Added the function :func:`cache_parameters`
263+
.. versionchanged:: 3.9
264+
Added the function :func:`!cache_parameters`
265265

266266
.. decorator:: total_ordering
267267

Doc/library/http.client.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ HTTPConnection Objects
319319
:class:`str` or bytes-like object that is not also a file as the
320320
body representation.
321321

322-
.. versionadded:: 3.2
322+
.. versionchanged:: 3.2
323323
*body* can now be an iterable.
324324

325325
.. versionchanged:: 3.6
@@ -446,9 +446,8 @@ also send your request step by step, by using the four functions below.
446446
This is to avoid premature termination of the read of the request by
447447
the target server due to malformed encoding.
448448

449-
.. versionadded:: 3.6
450-
Chunked encoding support. The *encode_chunked* parameter was
451-
added.
449+
.. versionchanged:: 3.6
450+
Added chunked encoding support and the *encode_chunked* parameter.
452451

453452

454453
.. method:: HTTPConnection.send(data)

Doc/library/http.server.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,8 @@ provides three different variants:
328328
or the current directory if *directory* is not provided, directly
329329
mapping the directory structure to HTTP requests.
330330

331-
.. versionadded:: 3.7
332-
The *directory* parameter.
331+
.. versionchanged:: 3.7
332+
Added the *directory* parameter.
333333

334334
.. versionchanged:: 3.9
335335
The *directory* parameter accepts a :term:`path-like object`.
@@ -433,29 +433,29 @@ to bind to localhost only::
433433

434434
python -m http.server --bind 127.0.0.1
435435

436-
.. versionadded:: 3.4
437-
``--bind`` argument was introduced.
436+
.. versionchanged:: 3.4
437+
Added the ``--bind`` option.
438438

439-
.. versionadded:: 3.8
440-
``--bind`` argument enhanced to support IPv6
439+
.. versionchanged:: 3.8
440+
Support IPv6 in the ``--bind`` option.
441441

442442
By default, the server uses the current directory. The option ``-d/--directory``
443443
specifies a directory to which it should serve the files. For example,
444444
the following command uses a specific directory::
445445

446446
python -m http.server --directory /tmp/
447447

448-
.. versionadded:: 3.7
449-
``--directory`` argument was introduced.
448+
.. versionchanged:: 3.7
449+
Added the ``--directory`` option.
450450

451451
By default, the server is conformant to HTTP/1.0. The option ``-p/--protocol``
452452
specifies the HTTP version to which the server is conformant. For example, the
453453
following command runs an HTTP/1.1 conformant server::
454454

455455
python -m http.server --protocol HTTP/1.1
456456

457-
.. versionadded:: 3.11
458-
``--protocol`` argument was introduced.
457+
.. versionchanged:: 3.11
458+
Added the ``--protocol`` option.
459459

460460
.. class:: CGIHTTPRequestHandler(request, client_address, server)
461461

@@ -519,5 +519,5 @@ default :class:`BaseHTTPRequestHandler` ``.log_message``
519519
implementation. This could allow remote clients connecting to your
520520
server to send nefarious control codes to your terminal.
521521

522-
.. versionadded:: 3.11.1
522+
.. versionchanged:: 3.11.1
523523
Control characters are scrubbed in stderr logs.

Doc/library/logging.config.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ in :mod:`logging` itself) and defining handlers which are declared either in
127127
application (e.g. based on command-line parameters or other aspects
128128
of the runtime environment) before being passed to ``fileConfig``.
129129

130-
.. versionadded:: 3.10
131-
The *encoding* parameter is added.
130+
.. versionchanged:: 3.10
131+
Added the *encoding* parameter.
132132

133133
.. versionchanged:: 3.11.4
134134
An exception will be thrown if the provided file

Doc/library/logging.handlers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,8 +871,8 @@ supports sending logging messages to an email address via SMTP.
871871
A timeout can be specified for communication with the SMTP server using the
872872
*timeout* argument.
873873

874-
.. versionadded:: 3.3
875-
The *timeout* argument was added.
874+
.. versionchanged:: 3.3
875+
Added the *timeout* parameter.
876876

877877
.. method:: emit(record)
878878

0 commit comments

Comments
 (0)