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 <NOT_FOUND>: # use the variable value print("Document not found") case other_code: # bind this name print("Other HTTP code", other_code) There is also some precedent for syntax like this. Everyone who has seen command-line interface descriptions such as: Usage: my_program <host> <port> will be able to intuitively grasp the meaning that it is about the *value* of the thing between the pointy brackets. Could this be a viable idea? Best regards, Richard
participants (1)
-
Richard Kleijn