pandas.errors.AbstractMethodError#
- exception pandas.errors.AbstractMethodError(class_instance, methodtype='method')[源代码][源代码]#
对于抽象方法,请引发此错误而不是 NotImplementedError。
例子
>>> class Foo: ... @classmethod ... def classmethod(cls): ... raise pd.errors.AbstractMethodError(cls, methodtype="classmethod") ... ... def method(self): ... raise pd.errors.AbstractMethodError(self) >>> test = Foo.classmethod() Traceback (most recent call last): AbstractMethodError: This classmethod must be defined in the concrete class Foo
>>> test2 = Foo().method() Traceback (most recent call last): AbstractMethodError: This classmethod must be defined in the concrete class Foo