Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support zope.interface #999

Closed
mithrandi opened this issue Sep 3, 2020 · 2 comments
Closed

Support zope.interface #999

mithrandi opened this issue Sep 3, 2020 · 2 comments
Labels
as designed Not a bug, working as intended enhancement request New feature or request

Comments

@mithrandi
Copy link

Something like https://github.com/Shoobx/mypy-zope

@mithrandi mithrandi added the enhancement request New feature or request label Sep 3, 2020
@dnaaun
Copy link

dnaaun commented Sep 3, 2020

Have a look at #637 . In essence, if something is not expressable in a stub file or with inline annotations according to the currently accepted list of PEPs, (ie, something needs a plugin), Pyright will not be supporting it "in the near future", if at all.

Also have you looked at Protocols, which are part of the ofificial spec for type checking in Python? They effectively let you express the same thing as zope interfaces(I think, never used zope.interface before) statically, and you can even use them in dynamic isinstance() calls if you decorate them with @typing.runtime_checkable()

@mithrandi
Copy link
Author

zope.interface provides nominal typing rather than structural typing (despite some confused language in PEP 544 to the contrary) so a z.i.Interface is more like an ABC than a Protocol. Anyhow, thanks for the reply!

@erictraut erictraut added the as designed Not a bug, working as intended label Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
as designed Not a bug, working as intended enhancement request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants