Skip to content

User-defined protocols #3838

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

Closed
JukkaL opened this issue Aug 16, 2017 · 3 comments
Closed

User-defined protocols #3838

JukkaL opened this issue Aug 16, 2017 · 3 comments

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Aug 16, 2017

This issue tracks the remaining things needed for making user-defined protocols work.

Now that #3132 was merged, mypy understand protocols. However, we still need runtime support for protocols (the Protocol class) and Protocol needs to be added to typeshed before protocols can actually be used in user code.

See also #3132 (comment).

Switching ABCs in typing to be protocols is a separate issue and requires coordination with other users of typeshed.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Aug 16, 2017

cc @ilevkivskyi

@ilevkivskyi
Copy link
Member

OK, here is a PR with runtime implementation in typing_extensions python/typing#464 and a PR with the corresponding stubs python/typeshed#1564

@JukkaL
Copy link
Collaborator Author

JukkaL commented Nov 22, 2017

This has been supported for a while now.

@JukkaL JukkaL closed this as completed Nov 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants