Open graingert opened 3 years ago
this would also allow me to define self-types: https://github.com/Shoobx/mypy-zope/issues/44
I'm not a big fan of having mypy_zope to be executed at runtime. It is a static analyzer and ideally shouldn't be a runtime dependency. And Protocols are kind of alternative to zope interfaces, so I suspect they will not play well together.
This is probably something that should land in zope.interface itself for the runtime component, but mypy-zope would need to be aware of it.
As far as protocols and interfaces playing nicely together, I think it should work fine; they're mostly different spellings of the same thing.
it should be possible to create a zope.interface.Interface by introspecting a
typing.Protocol