Pointy brackets for value patterns in Structural Pattern Matching
(my first post here after years of lurking)
PEP 635 mentions: "A proposed rule to use a leading dot (e.g. .CONSTANT) for that purpose was criticised because it was felt that the dot would not be a visible-enough marker for that purpose. Partly inspired by forms found in other programming languages, a number of different markers/sigils were proposed (such as ^CONSTANT, $CONSTANT, ==CONSTANT, CONSTANT?, or the word enclosed in backticks), although there was no obvious or natural choice."
Did anyone consider using pointy brackets to express a value pattern? To me they feel much more natural than the dismissed sigils/markers mentioned above.
Searching the mailing list it seems that so far pointy brackets only have been proposed for *capture* patterns.
I just read the thread David Mertz recently started (on the idea to use words rather than sigils). It occurred to me that the example he used can be quite neatly expressed using pointy brackets:
NOT_FOUND = 404
match http_code:
case 200:
print("OK document")
case
participants (1)
-
Richard Kleijn