How to force subclasses to implement a field using abstract base class in Python?

前端 未结 0 1924
梦毁少年i
梦毁少年i 2021-02-11 06:52

Abstract base class can force implementation of a method by all it\'s child classes using @abstractmethod decorator. Can the same be done with class fields?

相关标签:
回答
  • 消灭零回复
提交回复
热议问题