8000 bpo-41810: Reintroduce `types.EllipsisType`, `.NoneType` & `.NotImplementedType` by BvB93 · Pull Request #22336 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-41810: Reintroduce types.EllipsisType, .NoneType & .NotImplementedType #22336

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Sep 22, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Reworded parts of the constants documentation
  • Loading branch information
Bas van Beek committed Sep 22, 2020
commit 23ed559738432aae3e2cca47636c75f15abc341a
15 changes: 8 additions & 7 deletions Doc/library/constants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@ A small number of constants live in the built-in namespace. They are:

.. data:: None

The sole value of the type :data:`types.NoneType`. ``None`` is 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`.
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:`NoneType` type.


.. data:: NotImplemented

Sole value of the type :data:`types.NotImplementedType` and a
special value which should be returned by the binary special methods
A special value which should be returned by the binary special methods
(e.g. :meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, :meth:`__rsub__`,
etc.) to indicate that the operation is not implemented with respect to
the other type; may be returned by the in-place binary special methods
(e.g. :meth:`__imul__`, :meth:`__iand__`, etc.) for the same purpose.
It should not be evaluated in a boolean context.
``NotImplemented`` is the sole instance of the :data:`types.NotImplementedType` type.

.. note::

Expand Down Expand Up @@ -60,9 +61,9 @@ A small number of constants live in the built-in namespace. They are:
.. index:: single: ...; ellipsis literal
.. data:: Ellipsis

The same as the ellipsis literal "``...``" and sole value of the type
:data:`types.EllipsisType`. Special value used mostly in conjunction
The same as the ellipsis literal "``...``". Special value used mostly in conjunction
with extended slicing syntax for user-defined container data types.
``Ellipsis`` is the sole instance of the :data:`types.EllipsisType` type.


.. data:: __debug__
Expand Down
0