bpo-42128: Add what's new section for PEP 634 (pattern matching)#24588
bpo-42128: Add what's new section for PEP 634 (pattern matching)#24588gvanrossum wants to merge 1 commit into
Conversation
|
Guido, thanks for updating what's new. What do you think of adding a small FAQ section in the what's new too? Or just mentioning that the new statements use soft keywords and old identifiers won't break? I've seen quite a bit of FUD online, and I admit initially thinking my own code using Maybe: The match statement uses soft keywords. Only lines beginning with ``match``, containing a subject, a colon, and a line break will be identified as a match statement. Existing code using ``match`` as identifiers for variable names or functions will not break.Alternatively, copied straight from the PEP: The match and case keywords are *soft keywords*, i.e. they
are not reserved words in other grammatical contexts (including at the start of
a line if there is no colon where expected). This implies that they are
recognized as keywords when part of a match statement or case block only, and
are allowed to be used in all other contexts as variable or argument names.BTW, Daniel and I are tracking some of our own docs works here https://github.com/dmoisset/cpython/issues , though admittedly I haven't done much yet and I plan to sprint it over this weekend ;). |
Sorry, something went wrong.
Thanks for the reminder -- this indeed an important point. I believe this PR is likely dead, and it looks like @willingc is going to write us a better section. |
Sorry, something went wrong.
|
@gvanrossum I'm half way through the What's New and should post it tomorrow. |
Sorry, something went wrong.
|
Sorry, forgot! |
Sorry, something went wrong.
Obviously this shouldn't be merged before the main pattern matching PR (GH-22917).
https://bugs.python.org/issue42128