Skip to content

gh-129015: Move link supression around in a Note for exceptions.rst #129562

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 4 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 5 additions & 4 deletions Doc/library/constants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ A small number of constants live in the built-in namespace. They are:

See :ref:`implementing-the-arithmetic-operations` for examples.

.. note::
.. caution::

``NotImplementedError`` and :data:`!NotImplemented` are not interchangeable,
even though they have similar names and purposes.
See :exc:`NotImplementedError` for details on when to use it.
:data:`!NotImplemented` and :exc:`!NotImplementedError` are not
interchangeable. This constant should only be used as described
above; see :exc:`NotImplementedError` for details on correct usage
of the exception.

.. versionchanged:: 3.9
Evaluating :data:`!NotImplemented` in a boolean context was deprecated.
Expand Down
10 changes: 6 additions & 4 deletions Doc/library/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,13 @@ The following exceptions are the exceptions that are usually raised.
meant to be supported at all -- in that case either leave the operator /
method undefined or, if a subclass, set it to :data:`None`.

.. note::
.. caution::

:exc:`!NotImplementedError` and :data:`!NotImplemented` are not
interchangeable. This exception should only be used as described
above; see :data:`NotImplemented` for details on correct usage of
the built-in constant.

``NotImplementedError`` and :data:`NotImplemented` are not interchangeable,
even though they have similar names and purposes. See
:data:`!NotImplemented` for details on when to use it.

.. exception:: OSError([arg])
OSError(errno, strerror[, filename[, winerror[, filename2]]])
Expand Down
Loading