看到3.10版出了个match/case的语法糖就觉得奇怪
re.match用了无数次了,这个match怎么能跟if while同等地位,当做保留关键词呢
结果造了一个soft keyword的概念,有点无语
2.3.2. Soft Keywords?
New in version 3.10.
Some identifiers are only reserved under specific contexts. These are known as soft keywords. The identifiers match, case and _ can syntactically act as keywords in contexts related to the pattern matching statement, but this distinction is done at the parser level, not when tokenizing.
As soft keywords, their use with pattern matching is possible while still preserving compatibility with existing code that uses match, case and _ as identifier names.
--
FROM 114.245.100.*