[issue20897] @abstractmethod does not enforce method signatures

Eric Snow report at bugs.python.org
Tue Mar 18 15:28:32 CET 2014


Eric Snow added the comment:

Oops, typos.

> Both abstractmethod and abstractproperty work by setting
__isabstractmethod__ to True on the decorated function.  Then type.__new__

That should be type.__call__ or object.__new__, I don't remember which.

> looks for any attributes of the current class (including inherited ones)
that have __isabstractmethod__ set to True...
>
> As to SuperSubber working in Python 3, don't forget that metaclasses are
declared in the class signature:
>
> class SuperSubber(META):
>     pass

That should be:

class META(metaclass=abc.ABCMeta):

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20897>
_______________________________________


More information about the Python-bugs-list mailing list