Closed
Description
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.html
This would allow narrowing in the negative case and fix the type narrowing semantics of these methods.
Metadata
Metadata
Assignees
Labels
No labels