Skip to content

Commit f2eaa92

Browse files
authored
gh-101100: Fix sphinx warnings in Doc/library/__future__.rst (#109814)
1 parent 7b8bfe1 commit f2eaa92

File tree

2 files changed

+32
-27
lines changed

2 files changed

+32
-27
lines changed

Doc/library/__future__.rst

+32-26
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,48 @@
2222
can be inspected programmatically via importing :mod:`__future__` and examining
2323
its contents.
2424

25-
Each statement in :file:`__future__.py` is of the form::
25+
.. _future-classes:
2626

27-
FeatureName = _Feature(OptionalRelease, MandatoryRelease,
28-
CompilerFlag)
27+
.. class:: _Feature
2928

29+
Each statement in :file:`__future__.py` is of the form::
3030

31-
where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both are
32-
5-tuples of the same form as :data:`sys.version_info`::
31+
FeatureName = _Feature(OptionalRelease, MandatoryRelease,
32+
CompilerFlag)
3333

34-
(PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int
35-
PY_MINOR_VERSION, # the 1; an int
36-
PY_MICRO_VERSION, # the 0; an int
37-
PY_RELEASE_LEVEL, # "alpha", "beta", "candidate" or "final"; string
38-
PY_RELEASE_SERIAL # the 3; an int
39-
)
34+
where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both are
35+
5-tuples of the same form as :data:`sys.version_info`::
4036

41-
*OptionalRelease* records the first release in which the feature was accepted.
37+
(PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int
38+
PY_MINOR_VERSION, # the 1; an int
39+
PY_MICRO_VERSION, # the 0; an int
40+
PY_RELEASE_LEVEL, # "alpha", "beta", "candidate" or "final"; string
41+
PY_RELEASE_SERIAL # the 3; an int
42+
)
4243

43-
In the case of a *MandatoryRelease* that has not yet occurred,
44-
*MandatoryRelease* predicts the release in which the feature will become part of
45-
the language.
44+
.. method:: _Feature.getOptionalRelease()
4645

47-
Else *MandatoryRelease* records when the feature became part of the language; in
48-
releases at or after that, modules no longer need a future statement to use the
49-
feature in question, but may continue to use such imports.
46+
*OptionalRelease* records the first release in which the feature was accepted.
5047

51-
*MandatoryRelease* may also be ``None``, meaning that a planned feature got
52-
dropped.
48+
.. method:: _Feature.getMandatoryRelease()
5349

54-
Instances of class :class:`_Feature` have two corresponding methods,
55-
:meth:`getOptionalRelease` and :meth:`getMandatoryRelease`.
50+
In the case of a *MandatoryRelease* that has not yet occurred,
51+
*MandatoryRelease* predicts the release in which the feature will become part of
52+
the language.
5653

57-
*CompilerFlag* is the (bitfield) flag that should be passed in the fourth
58-
argument to the built-in function :func:`compile` to enable the feature in
59-
dynamically compiled code. This flag is stored in the :attr:`compiler_flag`
60-
attribute on :class:`_Feature` instances.
54+
Else *MandatoryRelease* records when the feature became part of the language; in
55+
releases at or after that, modules no longer need a future statement to use the
56+
feature in question, but may continue to use such imports.
57+
58+
*MandatoryRelease* may also be ``None``, meaning that a planned feature got
59+
dropped or that it is not yet decided.
60+
61+
.. attribute:: _Feature.compiler_flag
62+
63+
*CompilerFlag* is the (bitfield) flag that should be passed in the fourth
64+
argument to the built-in function :func:`compile` to enable the feature in
65+
dynamically compiled code. This flag is stored in the :attr:`_Feature.compiler_flag`
66+
attribute on :class:`_Feature` instances.
6167

6268
No feature description will ever be deleted from :mod:`__future__`. Since its
6369
introduction in Python 2.1 the following features have found their way into the

Doc/tools/.nitignore

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Doc/howto/enum.rst
2828
Doc/howto/isolating-extensions.rst
2929
Doc/howto/logging.rst
3030
Doc/howto/urllib2.rst
31-
Doc/library/__future__.rst
3231
Doc/library/abc.rst
3332
Doc/library/ast.rst
3433
Doc/library/asyncio-dev.rst

0 commit comments

Comments
 (0)