Advanced
Python
Q77 / 101
What is a Python abstract base class (ABC) used for?
Correct! Well done.
Incorrect.
The correct answer is B) To define interfaces with enforced method implementations via ABCMeta and @abstractmethod
B
Correct Answer
To define interfaces with enforced method implementations via ABCMeta and @abstractmethod
Explanation
ABCs (from abc module) raise TypeError at instantiation if abstract methods aren't implemented. They also support virtual subclassing via register().
Progress
77/101