Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04ac59a

Browse files
committed
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.
1 parent 4d71a66 commit 04ac59a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Doc/glossary.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ Glossary
3030
Abstract base classes complement :term:`duck-typing` by
3131
providing a way to define interfaces when other techniques like
3232
:func:`hasattr` would be clumsy or subtly wrong (for example with
33-
:ref:`magic methods <special-lookup>`). Python comes with many built-in ABCs for
33+
:ref:`magic methods <special-lookup>`). ABCs introduce virtual
34+
subclasses, which are classes that don't inherit from a class but are
35+
still recognized by :func:`isinstance` and :func:`issubclass`; see the
36+
:mod:`abc` module documentation. Python comes with many built-in ABCs for
3437
data structures (in the :mod:`collections` module), numbers (in the
3538
:mod:`numbers` module), streams (in the :mod:`io` module), import finders
3639
and loaders (in the :mod:`importlib.abc` module). You can create your own

0 commit comments

Comments
 (0)