我有以下代码:
class AppInterface(zope.interface.Interface):
def required_function():
pass
@zope.interface.implementer(AppInterface)
class DesktopApp:
def other_function(self):
print('Who I am')
我没有在DekstopApp中编写所需的函数,它必须引发错误。
但此代码是有效的。
但当我使用abc模块时,如果我没有编写所需的方法,我将得到一个错误
我应该使用abc还是zope.interface
目前没有回答
相关问题 更多 >
编程相关推荐