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

Add support for TypeGuard type narrowing pattern when called function is overloaded #3572

Closed
erictraut opened this issue Jun 13, 2022 · 2 comments
Labels
addressed in next version Issue is fixed and will appear in next published version enhancement request New feature or request

Comments

@erictraut
Copy link
Collaborator

Currently the TypeGuard (PEP 647) type narrowing logic does not handle the case where a function is overloaded with different TypeGuard return types. This was intentionally not implemented because of the evaluation cost associated with fully evaluating the overload.

This PR in typeshed is proposing to use this functionality.

@erictraut
Copy link
Collaborator Author

This will be included in the next release.

@erictraut erictraut added the addressed in next version Issue is fixed and will appear in next published version label Jun 19, 2022
@erictraut
Copy link
Collaborator Author

This is included in pyright 1.1.255, which I just published. It will also be included in the next release of pylance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed in next version Issue is fixed and will appear in next published version enhancement request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant