Replies: 1 comment 1 reply
-
I think it would be type safe to narrow it further in the fall-through case. The question is whether such an enhancement is worthwhile. Pyright's current behavior is arguably correct, but the resulting type could be more precise (narrower). Mypy appears to over-narrow the type to |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Code sample in pyright playground
I'm wondering if Pyright can safely narrow
c
to((int) -> Any)
in theelse
branchBeta Was this translation helpful? Give feedback.
All reactions