Subexpression type narrowing for match statements #4971
Labels
addressed in next version
Issue is fixed and will appear in next published version
enhancement request
New feature or request
Currently, pyright narrows only the subject expression of a match statement. However, there are cases where a subject expression contains a subexpression that could also be narrowed, at least in theory.
mypy
unable to narrow type of tuple elements incase
clause in pattern matching python/mypy#12364Likewise, expressions that utilize the subject as a subexpression could be narrowed, in theory.
I don't yet know if either of these can be implemented in a way that is computationally feasible, but it's worth investigating.
The text was updated successfully, but these errors were encountered: