Darren Dale <[email protected]> added the comment:

On Sat, Jun 11, 2011 at 3:11 AM, Daniel Urban <[email protected]> wrote:
>
> Daniel Urban <[email protected]> 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.

----------

_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11610>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to