Pyright can check exhaustiveness of match statements on unions
Pyright can check exhaustiveness of match statements on unions
![](https://programming.dev/pictrs/image/6b04cc37-55b4-455f-9382-7016cdab8f59.png?format=webp&thumbnail=128)
![](https://programming.dev/pictrs/image/6b04cc37-55b4-455f-9382-7016cdab8f59.png?format=webp)
Twitter user @DanyX23:
TIL: pyright, the python type checking engine that is used by VS Code, has support for exhaustiveness checking for match statements with union types!
If you add the following to your pyproject.toml, you'll get the attached warning
[tool.pyright] reportMatchNotExhaustive = true
You're viewing a single thread.
All Comments
11 comments
11 comments
Scroll to top