Closed arjenzorgdoc closed 1 month ago
I think this is a reasonable enhancement request. Narrowing in the fall-through case is safe if the pattern contains a single dictionary expand pattern and the type is provably a Mapping.
Incidentally, mypy doesn't support type narrowing in this case.
This will be included in the next release of pyright.
This is addressed in pyright 1.1.372.
If I want to match all
dict
s in a match statement I cannot usecase {**kw}:
. I need to usecase dict():
Is your feature request related to a problem? Please describe.
Code sample in pyright playground
Describe the solution you’d like
I would like that
case {**kw}:
would handle thedict
-case.