Demo code showing the new true exhaustiveness checking with Python 3.10 + Pyright. I created this repo to support my blog post and make it easy to try out this technique.
You'll need Poetry and Python 3.10. I used 3.10.6 and 3.10.7 to write this.
poetry install
poetry shell
To see the exhaustiveness checks for all the files:
pyright
VS Code has Pylance checking built into its Python extension. This brings the Pyright checking into the IDE. IMO it's an amazing experience.
Pylance/Pyright should pick up
the settings from pyproject.toml
. The settings in VS Code seem to mostly
be overridden by the file.