Article 56JQC [$] "Structural pattern matching" for Python, part 1

[$] "Structural pattern matching" for Python, part 1

by
jake
from LWN.net on (#56JQC)
We last looked at the idea of a Python"match" or "switch" statement back in 2016, but it is something that hasbeen circulating in the Python community both before and since that coverage.In June it was raised again, with a Python Enhancement Proposal (PEP)supporting it: PEP 622("Structural Pattern Matching"). As that title would imply, thematch statement proposed in the PEP is actually a pattern-matchingconstruct with many uses.While it may superficially resemble the C switch statement, aPython match would do far more than simply choose a chunk of codeto execute based on the value of an expression.
External Content
Source RSS or Atom Feed
Feed Location http://lwn.net/headlines/rss
Feed Title LWN.net
Feed Link https://lwn.net/
Reply 0 comments