See more:
- https://www.youtube.com/watch?v=S_ipdVNSFlo
- https://jellis18.github.io/post/2022-01-11-abc-vs-protocol/
In general there are two use cases for ABCs, as a pure ABC that defines an “interface” and as a tool for code re-use via the Framework Design Pattern or through Mixins.
Pure ABCs (ABC as Interface)
from abc import ABC, abstractmethod
class Animal(ABC):
@abstractmethod
def walk(self) -> None:
pass
@abstractmethod
def speak(self) -> None:
pass