Replies: 1 comment
-
|
Pyright is working as intended here. Type narrowing applies only to subexpressions that are found in the type guard expression (the conditional check). It does not track relationships between types of symbols. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Tested on pyright 1.1.379, python 3.11.9
Intuitively it seems like
yshould be narrowed here. And also in the looser case whereTisn't constrained. I might be missing something though?Beta Was this translation helpful? Give feedback.
All reactions