Skip to content

dogweather/python-exhaustiveness-adts-monads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Exhaustiveness Checking Demo

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.

To set up

You'll need Poetry and Python 3.10. I used 3.10.6 and 3.10.7 to write this.

poetry install
poetry shell

Now you can run Pyright

To see the exhaustiveness checks for all the files:

pyright

VS Code

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.

About

Demo code showing off the new true exhaustiveness checks with Python 3.10 + Pyright

Topics

Resources

Stars

Watchers

Forks

Languages