我不完全明白为什么关键字match
可以用作变量或函数名,不像其他关键字if
,while
等?
>>> match "abc":
... case "abc":
... print('Hello!')
...
Hello!
>>> from re import match
>>> match('A', 'A Something A')
<re.Match object; span=(0, 1), match='A'>
>>> match = '????'
>>> match
'????'
>>> case = 'something'
>>> case
'something'