Lines Matching refs:ABC
28 a helper class :class:`ABC` to alternatively define ABCs through inheritance:
30 .. class:: ABC
33 an abstract base class can be created by simply deriving from :class:`ABC`
36 from abc import ABC
38 class MyABC(ABC):
41 Note that the type of :class:`ABC` is still :class:`ABCMeta`, therefore
42 inheriting from :class:`ABC` requires the usual precautions regarding
59 Use this metaclass to create an ABC. An ABC can be subclassed directly, and
63 ABC by the built-in :func:`issubclass` function, but the registering ABC
65 implementations defined by the registering ABC be callable (not even via
72 Register *subclass* as a "virtual subclass" of this ABC. For
75 from abc import ABC
77 class MyABC(ABC):
98 Check whether *subclass* is considered a subclass of this ABC. This means
101 subclass of the ABC. (This class method is called from the
102 :meth:`__subclasscheck__` method of the ABC.)
105 it returns ``True``, the *subclass* is considered a subclass of this ABC.
107 this ABC, even if it would normally be one. If it returns
114 For a demonstration of these concepts, look at this example ABC definition::
124 class MyIterable(ABC):
143 The ABC ``MyIterable`` defines the standard iterable method,
180 inheritance; "virtual subclasses" registered with the ABC's :meth:`register`
187 class C(ABC):
255 class C(ABC):
276 class C(ABC):
297 class C(ABC):
307 class C(ABC):
334 The token changes with every call to :meth:`ABCMeta.register` on any ABC.