Skip to content

Commit 1d7bddd

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

28 files changed

+172
-173
lines changed

Doc/library/argparse.rst

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

1939-
.. versionadded:: 3.4
1940-
The *encodings* and *errors* keyword arguments.
1939+
.. versionchanged:: 3.4
1940+
Added the *encodings* and *errors* parameters.
19411941

19421942

19431943
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

@@ -1291,9 +1291,9 @@ Exceptions
12911291
that is already present or in strict parsers when a section if found more
12921292
than once in a single input file, string or dictionary.
12931293

1294-
.. versionadded:: 3.2
1295-
Optional ``source`` and ``lineno`` attributes and arguments to
1296-
:meth:`!__init__` were added.
1294+
.. versionchanged:: 3.2
1295+
Added the optional *source* and *lineno* attributes and parameters to
1296+
:meth:`!__init__`.
12971297

12981298

12991299
.. exception:: DuplicateOptionError

Doc/library/datetime.rst

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

860860
If an argument outside those ranges is given, :exc:`ValueError` is raised.
861861

862-
.. versionadded:: 3.6
863-
Added the ``fold`` argument.
862+
.. versionchanged:: 3.6
863+
Added the *fold* parameter.
864864

865865
Other constructors, all class methods:
866866

@@ -1258,8 +1258,8 @@ Instance methods:
12581258
:class:`datetime` objects are also supported by generic function
12591259
:func:`copy.replace`.
12601260

1261-
.. versionadded:: 3.6
1262-
Added the ``fold`` argument.
1261+
.. versionchanged:: 3.6
1262+
Added the *fold* parameter.
12631263

12641264

12651265
.. method:: datetime.astimezone(tz=None)
@@ -1502,8 +1502,8 @@ Instance methods:
15021502
>>> dt.isoformat(timespec='microseconds')
15031503
'2015-01-01T12:30:59.000000'
15041504

1505-
.. versionadded:: 3.6
1506-
Added the *timespec* argument.
1505+
.. versionchanged:: 3.6
1506+
Added the *timespec* parameter.
15071507

15081508

15091509
.. method:: datetime.__str__()
@@ -1839,8 +1839,8 @@ Instance methods:
18391839
:class:`time` objects are also supported by generic function
18401840
:func:`copy.replace`.
18411841

1842-
.. versionadded:: 3.6
1843-
Added the ``fold`` argument.
1842+
.. versionchanged:: 3.6
1843+
Added the *fold* parameter.
18441844

18451845

18461846
.. method:: time.isoformat(timespec='auto')
@@ -1883,8 +1883,8 @@ Instance methods:
18831883
>>> dt.isoformat(timespec='auto')
18841884
'12:34:56'
18851885

1886-
.. versionadded:: 3.6
1887-
Added the *timespec* argument.
1886+
.. versionchanged:: 3.6
1887+
Added the *timespec* parameter.
18881888

18891889

18901890
.. 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
@@ -383,8 +383,8 @@ The :class:`SequenceMatcher` class has this constructor:
383383
The optional argument *autojunk* can be used to disable the automatic junk
384384
heuristic.
385385

386-
.. versionadded:: 3.2
387-
The *autojunk* parameter.
386+
.. versionchanged:: 3.2
387+
Added the *autojunk* parameter.
388388

389389
SequenceMatcher objects get three data attributes: *bjunk* is the
390390
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
@@ -219,7 +219,6 @@ added matters. To illustrate::
219219
Default: :const:`False`.
220220

221221
.. versionadded:: 3.5
222-
The *mangle_from_* parameter.
223222

224223

225224
.. attribute:: message_factory

Doc/library/functions.rst

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

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

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

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

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

Doc/library/functools.rst

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

197-
The wrapped function is instrumented with a :func:`cache_parameters`
197+
The wrapped function is instrumented with a :func:`!cache_parameters`
198198
function that returns a new :class:`dict` showing the values for *maxsize*
199199
and *typed*. This is for information purposes only. Mutating the values
200200
has no effect.
@@ -275,8 +275,8 @@ The :mod:`functools` module defines the following functions:
275275
.. versionchanged:: 3.8
276276
Added the *user_function* option.
277277

278-
.. versionadded:: 3.9
279-
Added the function :func:`cache_parameters`
278+
.. versionchanged:: 3.9
279+
Added the function :func:`!cache_parameters`
280280

281281
.. decorator:: total_ordering
282282

Doc/library/http.client.rst

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

314-
.. versionadded:: 3.2
314+
.. versionchanged:: 3.2
315315
*body* can now be an iterable.
316316

317317
.. versionchanged:: 3.6
@@ -461,9 +461,8 @@ also send your request step by step, by using the four functions below.
461461
This is to avoid premature termination of the read of the request by
462462
the target server due to malformed encoding.
463463

464-
.. versionadded:: 3.6
465-
Chunked encoding support. The *encode_chunked* parameter was
466-
added.
464+
.. versionchanged:: 3.6
465+
Added chunked encoding support and the *encode_chunked* parameter.
467466

468467

469468
.. 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`.
@@ -438,29 +438,29 @@ to bind to localhost only::
438438

439439
python -m http.server --bind 127.0.0.1
440440

441-
.. versionadded:: 3.4
442-
``--bind`` argument was introduced.
441+
.. versionchanged:: 3.4
442+
Added the ``--bind`` option.
443443

444-
.. versionadded:: 3.8
445-
``--bind`` argument enhanced to support IPv6
444+
.. versionchanged:: 3.8
445+
Support IPv6 in the ``--bind`` option.
446446

447447
By default, the server uses the current directory. The option ``-d/--directory``
448448
specifies a directory to which it should serve the files. For example,
449449
the following command uses a specific directory::
450450

451451
python -m http.server --directory /tmp/
452452

453-
.. versionadded:: 3.7
454-
``--directory`` argument was introduced.
453+
.. versionchanged:: 3.7
454+
Added the ``--directory`` option.
455455

456456
By default, the server is conformant to HTTP/1.0. The option ``-p/--protocol``
457457
specifies the HTTP version to which the server is conformant. For example, the
458458
following command runs an HTTP/1.1 conformant server::
459459

460460
python -m http.server --protocol HTTP/1.1
461461

462-
.. versionadded:: 3.11
463-
``--protocol`` argument was introduced.
462+
.. versionchanged:: 3.11
463+
Added the ``--protocol`` option.
464464

465465
.. class:: CGIHTTPRequestHandler(request, client_address, server)
466466

@@ -537,5 +537,5 @@ default :class:`BaseHTTPRequestHandler` ``.log_message``
537537
implementation. This could allow remote clients connecting to your
538538
server to send nefarious control codes to your terminal.
539539

540-
.. versionadded:: 3.12
540+
.. versionchanged:: 3.12
541541
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.12
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

Doc/library/logging.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -615,14 +615,14 @@ Formatter Objects
615615
``logging.Formatter('%(ip)s %(message)s', defaults={"ip": None})``
616616
:type defaults: dict[str, Any]
617617

618-
.. versionadded:: 3.2
619-
The *style* parameter.
618+
.. versionchanged:: 3.2
619+
Added the *style* parameter.
620620

621-
.. versionadded:: 3.8
622-
The *validate* parameter.
621+
.. versionchanged:: 3.8
622+
Added the *validate* parameter.
623623

624-
.. versionadded:: 3.10
625-
The *defaults* parameter.
624+
.. versionchanged:: 3.10
625+
Added the *defaults* parameter.
626626

627627

628628
.. method:: format(record)

Doc/library/multiprocessing.shared_memory.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ copying of data.
8888
*track* is ignored on Windows, which has its own tracking and
8989
automatically deletes shared memory when all handles to it have been closed.
9090

91-
.. versionadded:: 3.13
92-
The *track* parameter.
91+
.. versionchanged:: 3.13
92+
Added the *track* parameter.
9393

9494
.. method:: close()
9595

0 commit comments

Comments
 (0)