"Structural pattern matching" for Python, part 1
"Structural pattern matching" for Python, part 1
Posted Aug 6, 2020 3:47 UTC (Thu) by cyphar (subscriber, #110703)In reply to: "Structural pattern matching" for Python, part 1 by mb
Parent article: "Structural pattern matching" for Python, part 1
A lot of these seem to be based on Rust's match feature (it even has the same name!). I agree that this seems out-of-place for Python, and while I think Python's staunch refusal to include switch-like statements is a flaw of the language (and one I'd like to see fixed) I wouldn't be happy with this design. Rust's matching design makes sense in the context of the rest of the language -- you can't just transplant it to another language and hope it fits.
The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:
Note: you can avoid this step in the future by logging into your LWN account.
