Skip to content

Commit f7b933c

Browse files
authored
Document next in versionadded & similar directives (GH-1413)
1 parent 0f959e0 commit f7b933c

File tree

1 file changed

+36
-7
lines changed

1 file changed

+36
-7
lines changed

documentation/markup.rst

+36-7
Original file line numberDiff line numberDiff line change
@@ -1083,16 +1083,42 @@ units as well as normal text:
10831083
(``class``, ``attribute``, ``function``, ``method``, ``c:type``, etc),
10841084
a ``versionadded`` should be included at the end of its description block.
10851085

1086-
The first argument must be given and is the version in question. The second
1087-
argument is optional and can be used to describe the details of the feature.
1086+
The first argument must be given and is the version in question.
1087+
Instead of a specific version number, you can---and should---use
1088+
the word ``next``, indicating that the API will first appear in the
1089+
upcoming release.
1090+
The second argument is optional and can be used to describe the details of the feature.
10881091

10891092
Example::
10901093

10911094
.. function:: func()
10921095

10931096
Return foo and bar.
10941097

1095-
.. versionadded:: 3.5
1098+
.. versionadded:: next
1099+
1100+
When a release is made, the release manager will change the ``next`` to
1101+
the just-released version. For example, if ``func`` in the above example is
1102+
released in 3.14, the snippet will be changed to::
1103+
1104+
.. function:: func()
1105+
1106+
Return foo and bar.
1107+
1108+
.. versionadded:: 3.14
1109+
1110+
The tool to do this replacement is `update_version_next.py`_
1111+
in the release-tools repository.
1112+
1113+
.. _update_version_next.py: https://github.com/python/release-tools/blob/master/update_version_next.py
1114+
1115+
When backporting to versions before 3.14, check if ``Doc/tools/extensions/pyspecific.py``
1116+
contains the function ``expand_version_arg``. If it's not there,
1117+
use a specific version instead of ``next``.
1118+
1119+
When adding documentation for a function that existed in a past version,
1120+
but wasn't documented yet, use the version number where the function was
1121+
added instead of ``next``.
10961122

10971123
.. describe:: versionchanged
10981124

@@ -1106,7 +1132,7 @@ units as well as normal text:
11061132

11071133
Return foo and bar, optionally with *spam* applied.
11081134

1109-
.. versionchanged:: 3.6
1135+
.. versionchanged:: next
11101136
Added the *spam* parameter.
11111137

11121138
Note that there should be no blank line between the directive head and the
@@ -1118,22 +1144,25 @@ units as well as normal text:
11181144

11191145
There is one required argument: the version from which the feature is
11201146
deprecated.
1147+
Similarly to ``versionadded``, you should use the word ``next`` to indicate
1148+
the API will be first deprecated in the upcoming release.
11211149

11221150
Example::
11231151

1124-
.. deprecated:: 3.8
1152+
.. deprecated:: next
11251153

11261154
.. describe:: deprecated-removed
11271155

11281156
Like ``deprecated``, but it also indicates in which version the feature is
11291157
removed.
11301158

11311159
There are two required arguments: the version from which the feature is
1132-
deprecated, and the version in which the feature is removed.
1160+
deprecated (usually ``next``), and the version in which the feature
1161+
is removed, which must be a specific version number (*not* ``next``).
11331162

11341163
Example::
11351164

1136-
.. deprecated-removed:: 3.8 4.0
1165+
.. deprecated-removed:: next 4.0
11371166

11381167
.. describe:: impl-detail
11391168

0 commit comments

Comments
 (0)