abc.ABCMeta

class abc.ABCMeta[source]

Metaclass for defining Abstract Base Classes (ABCs).

Use this metaclass to create an ABC. An ABC can be subclassed directly, and then acts as a mix-in class. You can also register unrelated concrete classes (even built-in classes) and unrelated ABCs as ‘virtual subclasses’ – these and their descendants will be considered subclasses of the registering ABC by the built-in issubclass() function, but the registering ABC won’t show up in their MRO (Method Resolution Order) nor will method implementations defined by the registering ABC be callable (not even via super()).

Methods

__format__ default object formatter
__instancecheck__(instance) Override for isinstance(instance, cls).
__new__(mcls, name, bases, namespace)
__reduce__ helper for pickle
__reduce_ex__ helper for pickle
__sizeof__(() -> int) size of object in memory, in bytes
__subclasscheck__(subclass) Override for issubclass(subclass, cls).
__subclasses__(...)
__subclasshook__ Abstract classes can override this to customize issubclass().
_dump_registry([file]) Debug helper to print the ABC registry.
mro(() -> list) return a type’s method resolution order
register(subclass) Register a virtual subclass of an ABC.