You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
In bpo-44010, we are trying, as best as is possible with comprehensible REs, to identify in which circumstances occurrences of 'match', 'case' and '_' are keywords, and should be marked as such. I was initially unsure and even wrong about '_'.
Capture Patterns: I was confused by 'And is instead...'. 'It is instead ...', where 'it' refers to '_', is clearer to me.
Wildcard Patterns: "'_' is a soft keyword" just says it sometimes is and sometimes is not, but not when, or rather, where. After experiments like this (using the new IDLE 'copy with prompts' option ;-):
>>> _ ='a'
>>> match [_, 'b']:
... case [capture, _] if _ =='a':
... print(capture, _)
...
a a
I added (in PR to come, with markup that might be improved)
"within any pattern, but only within patterns. It is an identifier, as usual, even within match headers, guards, and case blocks.
Please consider also adding an example like the above.
bedevere-bot malfunctioned. Lukasz merged PR 25873 into main, and I verified the change on the main branch. But the PR is listed above as closed, not merged, and commit 3b200b2 is not listed.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: