You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I originally contributed the annotations for these methods in #339. That PR has a bunch of context about how the fact that TypeGuard only narrows in the positive case, while the methods should narrow in both the positive and negative case.
I originally contributed the annotations for these methods in #339. That PR has a bunch of context about how the fact that
TypeGuard
only narrows in the positive case, while the methods should narrow in both the positive and negative case.TypeIs
was recently introduced as a PEP and mypy added support for it, I suspect pyright as well: https://mypy-lang.blogspot.com/2024/04/mypy-110-released.htmlThis would allow narrowing in the negative case and fix the type narrowing semantics of these methods.
The text was updated successfully, but these errors were encountered: