我正在使用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