Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Tyr42
on June 24, 2020
|
parent
|
context
|
favorite
| on:
PEP 622 – Structural Pattern Matching
I would say it's not a smart switch statement, since you can bind variables.
match shape: case Point(x, y): ... case Rectangle(x, y, _, _): ... print(x, y) # This works
Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: