from abc import abstractmethod, ABCMeta

class AbstractClass(metaclass=ABCMeta):
    @abstractmethod
    def my_method(self):
        pass

class MyClass(AbstractClass):
    def my_method(self):
        print('my_method')
  • abc: Abstract Base Class
  • @abstractmethod 데코레이터가 달린 메소드는 전부 구현해야 한다.