mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Mention virtual subclasses in the glossary entry for ABCs (#12256).
I added a link from the term “virtual subclass” to the glossary entry for ABCs but this was not enough, now the glossary briefly defines “virtual” and links to the abc module doc which contains more mentions of virtual subclasses.
This commit is contained in:
parent
4d71a66a01
commit
04ac59a22a
1 changed files with 4 additions and 1 deletions
|
@ -30,7 +30,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>`). Python comes with many built-in ABCs for
|
||||
: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
|
||||
:mod:`abc` module documentation. Python comes with many built-in ABCs for
|
||||
data structures (in the :mod:`collections` module), numbers (in the
|
||||
:mod:`numbers` module), streams (in the :mod:`io` module), import finders
|
||||
and loaders (in the :mod:`importlib.abc` module). You can create your own
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue