Created
June 9, 2019 05:01
-
-
Save jonascheng/3b22f97673b3309ba00d5b8e9a24c820 to your computer and use it in GitHub Desktop.
SOLID-BirdClass-ISP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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