【发布时间】:2014-05-30 15:36:33
【问题描述】:
我使用zope.interface 模块来声明一个带有一些方法和属性的接口。另外,我不能以某种方式不仅声明属性名称,还声明它们的类型吗?
from zope.interface import Interface, Attribute, implementer, verify
class IVehicle(Interface):
"""Any moving thing"""
speed = Attribute("""Movement speed""") #CANNOT I DECLARE ITS TYPE HERE?
def move():
"""Make a single step"""
pass
【问题讨论】:
标签: python zope.interface