ID EN
ABC

ABC

Python 3.11

A helper class that has ABCMeta as its metaclass. With this class, an abstract base class can be created by simply deriving from ABC avoiding sometimes confusing metaclass usage, for example:

Syntax

PYTHON
class abc.ABC

Examples

Example 1
PYTHON
from abc import ABC

class MyABC(ABC):
    pass
Example 2
PYTHON
from abc import ABCMeta

class MyABC(metaclass=ABCMeta):
    pass

See Also

ABCMeta ABCMeta