]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-89554: Document NoneType, NotImplementedType and EllipsisType as classes...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 2 Jun 2026 08:02:22 +0000 (10:02 +0200)
committerGitHub <noreply@github.com>
Tue, 2 Jun 2026 08:02:22 +0000 (08:02 +0000)
Always use the directive and the role "class" instead of "data" for
NoneType, NotImplementedType and EllipsisType.
(cherry picked from commit e40190e104c81b61cdc6f71a391e28de53bbc1d8)

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
Doc/library/constants.rst
Doc/library/types.rst
Doc/whatsnew/3.10.rst

index d058ba206c6cd62720300d8ee3776ca06eea4cba..6f005f98bd3ede57408e6a57710773490c98149c 100644 (file)
@@ -22,7 +22,7 @@ A small number of constants live in the built-in namespace.  They are:
    An object frequently used to represent the absence of a value, as when
    default arguments are not passed to a function. Assignments to ``None``
    are illegal and raise a :exc:`SyntaxError`.
-   ``None`` is the sole instance of the :data:`~types.NoneType` type.
+   ``None`` is the sole instance of the :class:`~types.NoneType` type.
 
 
 .. data:: NotImplemented
@@ -33,7 +33,7 @@ A small number of constants live in the built-in namespace.  They are:
    the other type; may be returned by the in-place binary special methods
    (e.g. :meth:`~object.__imul__`, :meth:`~object.__iand__`, etc.) for the same purpose.
    It should not be evaluated in a boolean context.
-   :data:`!NotImplemented` is the sole instance of the :data:`types.NotImplementedType` type.
+   :data:`!NotImplemented` is the sole instance of the :class:`types.NotImplementedType` type.
 
    .. note::
 
@@ -68,7 +68,7 @@ A small number of constants live in the built-in namespace.  They are:
    The same as the ellipsis literal "``...``", an object frequently used to
    indicate that something is omitted. Assignment to ``Ellipsis`` is possible, but
    assignment to  ``...`` raises a :exc:`SyntaxError`.
-   ``Ellipsis`` is the sole instance of the :data:`types.EllipsisType` type.
+   ``Ellipsis`` is the sole instance of the :class:`types.EllipsisType` type.
 
 
 .. data:: __debug__
index 2bedd7fdd3c8c8c4b93d76d5b675ec1d6fec428b..df3306a7061987c284915d4192433e67eff1ef25 100644 (file)
@@ -143,7 +143,7 @@ If you instantiate any of these types, note that signatures may vary between Pyt
 
 Standard names are defined for the following types:
 
-.. data:: NoneType
+.. class:: NoneType
 
    The type of :data:`None`.
 
@@ -233,7 +233,7 @@ Standard names are defined for the following types:
    .. versionadded:: 3.7
 
 
-.. data:: NotImplementedType
+.. class:: NotImplementedType
 
    The type of :data:`NotImplemented`.
 
@@ -273,7 +273,7 @@ Standard names are defined for the following types:
          creating :class:`!ModuleType` instances which ensures the various
          attributes are set appropriately.
 
-.. data:: EllipsisType
+.. class:: EllipsisType
 
    The type of :data:`Ellipsis`.
 
index d90a18076e548883c0ec10d93b104d1aea5e05b1..5e393ffab60acdda9513361c36986ca3e02bb5b1 100644 (file)
@@ -1446,8 +1446,8 @@ as a positional-only argument.
 types
 -----
 
-Reintroduce the :data:`types.EllipsisType`, :data:`types.NoneType`
-and :data:`types.NotImplementedType` classes, providing a new set
+Reintroduce the :class:`types.EllipsisType`, :class:`types.NoneType`
+and :class:`types.NotImplementedType` classes, providing a new set
 of types readily interpretable by type checkers.
 (Contributed by Bas van Beek in :issue:`41810`.)