Skip to content

Instantly share code, notes, and snippets.

@jonascheng
Created June 9, 2019 05:01
Show Gist options
  • Save jonascheng/3b22f97673b3309ba00d5b8e9a24c820 to your computer and use it in GitHub Desktop.
Save jonascheng/3b22f97673b3309ba00d5b8e9a24c820 to your computer and use it in GitHub Desktop.
SOLID-BirdClass-ISP
import abc
class Walkable(abc.ABC):
@abc.abstractmethod
def walk(self):
return NotImplemented
class Flyable(abc.ABC):
@abc.abstractmethod
def fly(self):
return NotImplemented
class FlyableBird(Walkable, Flyable):
pass
class DisFlyableBird(Walkable):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment