this post was submitted on 23 Apr 2024
81 points (100.0% liked)

Python

6366 readers
1 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

๐Ÿ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

๐Ÿ Python project:
๐Ÿ’“ Python Community:
โœจ Python Ecosystem:
๐ŸŒŒ Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
 

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 are viewing a single comment's thread
view the rest of the comments
[โ€“] mao@lemmy.sdf.org 0 points 6 months ago

I feel like Python is coming to its senses in the recent years, with releases focusing on typing constructs and the match statement. I think they're on the path to be a great statically typed language, don't you think?