I don't fully understand why the keyword match
can be used as a variable or function name, unlike other keywords if
, while
, etc.?
>>> 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'