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

PEP 647 (TypeGuard) #425

Closed
JelleZijlstra opened this issue May 11, 2021 · 4 comments
Closed

PEP 647 (TypeGuard) #425

JelleZijlstra opened this issue May 11, 2021 · 4 comments

Comments

@JelleZijlstra
Copy link
Contributor

I'd like to start using https://www.python.org/dev/peps/pep-0647/ in typeshed. Do you have any plans in that direction already?

I can look into adding basic support to unblock typeshed, which would mean simply interpreting TypeGuard[...] as an alias for bool.

@pradeep90
Copy link
Contributor

Thanks for opening an issue with Pyre. We don't have plans in that direction in the near future. Looks like you mainly want to use it Typeshed stubs (i.e., replace bool with TypeGuard[...] as the return type).

I've added a workaround to recognize TypeGuard as a generic bool for the time being. We'll release a new open-source version of Pyre in the next two weeks.

Btw, I'm curious which functions you plan to use TypeGuard on. Could you add a brief list to your original PR? :)

@JelleZijlstra
Copy link
Contributor Author

Thanks! I added examples of functions for which TypeGuard could be useful to the typeshed issue.

@stroxler
Copy link
Contributor

cc @kbansal I believe you've implemented TypeGuard support, can we close this issue?

@kbansal
Copy link
Contributor

kbansal commented Feb 14, 2022

Yes, this is now implemented. Closing.

@kbansal kbansal closed this as completed Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants