https://github.com/python/cpython/commit/6781fe743ae9df4be510568ad9b676fd20e7b843
commit: 6781fe743ae9df4be510568ad9b676fd20e7b843
branch: main
author: Thejesh <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-11-10T20:19:05Z
summary:
gh-161007: Add a glossary entry for "virtual subclass" (#161182)
files:
M Doc/glossary.rst
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
index a31bd53f06294d..f0934dc2e13877 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -29,9 +29,10 @@ Glossary
Abstract base classes complement :term:`duck-typing` by
providing a way to define interfaces when other techniques like
:func:`hasattr` would be clumsy or subtly wrong (for example with
- :ref:`magic methods <special-lookup>`). ABCs introduce virtual
- subclasses, which are classes that don't inherit from a class but are
- still recognized by :func:`isinstance` and :func:`issubclass`; see the
+ :ref:`magic methods <special-lookup>`). ABCs introduce
+ :term:`virtual subclasses <virtual subclass>`, which are classes that
+ don't inherit from a class but are still recognized by
+ :func:`isinstance` and :func:`issubclass`; see the
:mod:`abc` module documentation. Python comes with many built-in ABCs
for
data structures (in the :mod:`collections.abc` module), numbers (in the
:mod:`numbers` module), streams (in the :mod:`io` module), import finders
@@ -1727,6 +1728,12 @@ Glossary
A computer defined entirely in software. Python's virtual machine
executes the :term:`bytecode` emitted by the bytecode compiler.
+ virtual subclass
+ A class that :func:`issubclass` and :func:`isinstance` treat as a
+ subclass of an :term:`abstract base class` even though it does not
+ inherit from it. A class is made a virtual subclass by registering
+ it with the ABC's :meth:`~abc.ABCMeta.register` method.
+
walrus operator
A light-hearted way to refer to the :ref:`assignment expression
<assignment-expressions>` operator ``:=`` because it looks a bit like 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]