https://github.com/python/cpython/commit/9cd3c61f385ef65664404cf1caa70b57e5e626c7
commit: 9cd3c61f385ef65664404cf1caa70b57e5e626c7
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: hugovk <[email protected]>
date: 2026-10-31T20:13:34+02:00
summary:

[3.14] Docs: gh-161005: simplify subtype notation in `numbers.rst` (GH-161006) 
(#161024)

Co-authored-by: sai <[email protected]>
Co-authored-by: Ned Batchelder <[email protected]>

files:
M Doc/library/numbers.rst

diff --git a/Doc/library/numbers.rst b/Doc/library/numbers.rst
index 0ed24b4e6c5225d..a0ef2fcc37ad4ea 100644
--- a/Doc/library/numbers.rst
+++ b/Doc/library/numbers.rst
@@ -93,7 +93,7 @@ them to the same values. This may be subtle if there are two 
different
 extensions of the real numbers. See also :ref:`numeric-hash`.
 
 
-Adding More Numeric ABCs
+Adding more numeric ABCs
 ~~~~~~~~~~~~~~~~~~~~~~~~
 
 There are, of course, more possible ABCs for numbers, and this would
@@ -143,11 +143,12 @@ defined as::
 
 
 There are 5 different cases for a mixed-type operation on subclasses
-of :class:`Complex`. I'll refer to all of the above code that doesn't
-refer to ``MyIntegral`` and ``OtherTypeIKnowAbout`` as
-"boilerplate". ``a`` will be an instance of ``A``, which is a subtype
-of :class:`Complex` (``a : A <: Complex``), and ``b : B <:
-Complex``. I'll consider ``a + b``:
+of :class:`Complex`. All of the above code that doesn't refer to
+``MyIntegral`` and ``OtherTypeIKnowAbout`` is referred to as "boilerplate".
+
+In this description, ``a`` is an instance of ``A`` and ``b`` is an
+instance of ``B``, where ``A`` and ``B`` are both subtypes of :class:`Complex`.
+Consider ``a + b``:
 
 1. If ``A`` defines an :meth:`~object.__add__` which accepts ``b``, all is
    well.
@@ -162,13 +163,14 @@ Complex``. I'll consider ``a + b``:
 4. If it falls back to the boilerplate, there are no more possible
    methods to try, so this is where the default implementation
    should live.
-5. If ``B <: A``, Python tries ``B.__radd__`` before
+5. If ``B`` is a subtype of ``A``, Python tries ``B.__radd__`` before
    ``A.__add__``. This is ok, because it was implemented with
    knowledge of ``A``, so it can handle those instances before
    delegating to :class:`Complex`.
 
-If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge,
-then the appropriate shared operation is the one involving the built
+If ``A`` is a subtype of :class:`Complex` and ``B`` is a subtype of
+:class:`Real` without sharing any other knowledge, then the appropriate
+shared operation is the one involving the built
 in :class:`complex`, and both :meth:`~object.__radd__` s land there, so ``a+b
 == b+a``.
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to