What is the purpose of the abc module’s @abstractmethod decorator?

Python Developer Medium

Python Developer — Medium

What is the purpose of the abc module’s @abstractmethod decorator?

Key points

  • @abstractmethod marks methods that must be implemented in subclasses
  • Helps enforce method implementation in subclasses
  • Prevents instantiation of classes with unimplemented abstract methods

Ready to go further?

Related questions