|
|
Log in / Subscribe / Register

"Structural pattern matching" for Python, part 1

"Structural pattern matching" for Python, part 1

Posted Aug 5, 2020 18:47 UTC (Wed) by josh (subscriber, #17465)
Parent article: "Structural pattern matching" for Python, part 1

I'd love to have this in Python.

One thought: we have pattern matching in Rust, and it's incredibly helpful. The whole "matching a declared constant" thing is a problem in Rust, too, and even though Rust constants are declared in advance and statically typed, it's *still* a potential source of ambiguity; we've wished several times that there was a dedicated syntax to avoid the ambiguity.


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.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds