Created
March 23, 2019 01:40
-
-
Save razhangwei/9866dde1458fc5d6b6289c5c219907ec to your computer and use it in GitHub Desktop.
Python abstract class #Python
This file contains hidden or 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
| from abc import ABC, abstractmethod | |
| class Foo(ABC, object): | |
| @property | |
| @abstractmethod | |
| def f(self): | |
| pass | |
| @abstractmethod | |
| def g(self): | |
| pass | |
| class Bar(Foo): | |
| @property | |
| def f(self): | |
| return 0 | |
| def g(self): | |
| print("hhh") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment