사용자 정의 기본 클래스는 NotImplementedError를 발생시켜 인터페이스를 시뮬레이션하는 하위 클래스에서 메서드나 동작을 정의해야 함을 나타낼 수 있습니다. 이 예외는 RuntimeError에서 파생됩니다. 사용자 정의 기본 클래스에서 추상 메서드는 파생 클래스가 메서드를 재정의해야 할 때 이 예외를 발생시켜야 합니다.
예시
import sys
try:
class Super(object):
@property
def example(self):
raise NotImplementedError("Subclasses should implement this!")
s = Super()
print s.example
except Exception as e:
print e
print sys.exc_type 출력
Subclasses should implement this! <type 'exceptions.NotImplementedError'>