Section: Inheritance and protocols

ABC abstract method

python
python
from abc import ABC, abstractmethod

class Shape(ABC):
    @abstractmethod
    def area(self) -> float:
        raise NotImplementedError

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Inheritance and protocols
Subclass
Subclass
OpenIn sheetpythonsame section
Property getter/setter
Property getter/setter
OpenIn sheetpythonsame section
Call super
Call super
OpenIn sheetpythonsame section
Basic class
Basic class
OpenIn sheetpython1 tag match
Class method
Class method
OpenIn sheetpython1 tag match
Static method
Static method
OpenIn sheetpython1 tag match