mypy-zope
mypy-zope copied to clipboard
convert a protocol to an interface
it should be possible to create a zope.interface.Interface by introspecting a typing.Protocol
class SomeProtocol(typing.Protocol):
@property
def foo(self) -> str: ...
def ham(self) -> int: ...
ISome = mypy_zope.fromProtocol("ISome", SomeProtocol)