Author dsdale24
Recipients Darren.Dale, benjamin.peterson, daniel.urban, dsdale24, eric.araujo, ncoghlan, stutzbach
Date 2011-06-11.09:23:54
SpamBayes Score 1.15074e-06
Marked as misclassified No
Message-id <BANLkTikwiSxLdCY83yn7hM46Jjr-Tu3zJg@mail.gmail.com>
In-reply-to <1307776291.64.0.133148733288.issue11610@psf.upfronthosting.co.za>
Content
On Sat, Jun 11, 2011 at 3:11 AM, Daniel Urban <report@bugs.python.org> wrote:
>
> Daniel Urban <urban.dani+py@gmail.com> added the comment:
>
> It doesn't work with staticmethod:
>
>>>> import abc
>>>>
>>>> class C(metaclass=abc.ABCMeta):
> ...     @staticmethod
> ...     @abc.abstractmethod
> ...     def foo(x):
> ...             raise NotImplementedError()
> ...
>>>> class D(C):
> ...     @staticmethod
> ...     def foo(x):
> ...             return x + 1
> ...
>>>> D()
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> TypeError: Can't instantiate abstract class D with abstract methods foo.__func__

You still need to use @abc.abstractstaticmethod.
History
Date User Action Args
2011-06-11 09:23:55dsdale24setrecipients: + dsdale24, ncoghlan, benjamin.peterson, stutzbach, eric.araujo, daniel.urban, Darren.Dale
2011-06-11 09:23:54dsdale24linkissue11610 messages
2011-06-11 09:23:54dsdale24create