Skip to content

Commit da1ab85

Browse files
author
Bas van Beek
committed
Added types.NoneType & types.NotImplementedType to whatsnew and the docs
1 parent 2791a23 commit da1ab85

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

Doc/library/constants.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ A small number of constants live in the built-in namespace. They are:
1919

2020
.. data:: None
2121

22-
The sole value of the type ``NoneType``. ``None`` is frequently used to
22+
The sole value of the type :data:`types.NoneType`. ``None`` is frequently used to
2323
represent the absence of a value, as when default arguments are not passed to a
2424
function. Assignments to ``None`` are illegal and raise a :exc:`SyntaxError`.
2525

2626

2727
.. data:: NotImplemented
2828

29-
Special value which should be returned by the binary special methods
29+
Sole value of the type :data:`types.NotImplementedType` and a
30+
special value which should be returned by the binary special methods
3031
(e.g. :meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, :meth:`__rsub__`,
3132
etc.) to indicate that the operation is not implemented with respect to
3233
the other type; may be returned by the in-place binary special methods

Doc/library/types.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ If you instantiate any of these types, note that signatures may vary between Pyt
103103

104104
Standard names are defined for the following types:
105105

106+
.. data:: NoneType
107+
108+
The type of :data:`None`.
109+
110+
.. versionadded:: 3.10
111+
112+
106113
.. data:: FunctionType
107114
LambdaType
108115

@@ -186,6 +193,13 @@ Standard names are defined for the following types:
186193
.. versionadded:: 3.7
187194

188195

196+
.. data:: NotImplementedType
197+
198+
The type of :data:`NotImplemented`.
199+
200+
.. versionadded:: 3.10
201+
202+
189203
.. data:: MethodDescriptorType
190204

191205
The type of methods of some built-in data types such as :meth:`str.join`.

Doc/whatsnew/3.10.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ arguments passed to the Python executable.
148148
types
149149
-----
150150

151-
Reintroduced the :data:`types.EllipsisType` class.
151+
Reintroduced the :data:`types.EllipsisType`, :data:`types.NoneType`
152+
and :data:`types.NotImplementedType` classes.
152153
(Contributed by Bas van Beek in :issue:`41810`.)
153154

154155
unittest
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
:data:`types.EllipsisType` has been reintroduced.
1+
:data:`types.EllipsisType`, :data:`types.EllipsisType` and
2+
:data:`types.NoneType` have been reintroduced.

0 commit comments

Comments
 (0)