This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pablogsal
Recipients ezio.melotti, mrabarnett, pablogsal, steven.daprano
Date 2021-06-08.00:06:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1623110799.63.0.512192381316.issue44341@roundup.psfhosted.org>
In-reply-to
Content
I don't understand this example. 

> importing re.match directly into __main__ replaces the keyword with the function. 

It has not replaced anything, if you do a match statement it works and doesn't call your function. For example:

>>> x = [1,2]
>>>
>>> def match(*args):
...    print("Oh no")
...
>>> match x:
...    case [y,z]:
...       print(y,z)
...
1 2

Here "match" when used as a statement has not been replaced by the function that prints "oh no" so the match statement works as expected and so does the function:

>>> match
<function match at 0x7f7c173c5ff0>
History
Date User Action Args
2021-06-08 00:06:39pablogsalsetrecipients: + pablogsal, ezio.melotti, mrabarnett, steven.daprano
2021-06-08 00:06:39pablogsalsetmessageid: <1623110799.63.0.512192381316.issue44341@roundup.psfhosted.org>
2021-06-08 00:06:39pablogsallinkissue44341 messages
2021-06-08 00:06:39pablogsalcreate