【发布时间】:2014-02-02 08:14:36
【问题描述】:
考虑如下类:
from zope.interface import implementer
@implementer(IMessage)
class Foo:
@classmethod
def parse(Klass, msg):
"""
Parses `msg` into an instance of :class:`Foo`.
:returns obj -- An instance of :class:`Foo`.
"""
如何在 Zope 接口IMessage 中指定类方法?
在 Zope 界面中使用 @classmethod 装饰器会导致
zope.interface.exceptions.InvalidInterface: Concrete attribute, parse
【问题讨论】: