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 ojob
Recipients ojob, steven.daprano
Date 2021-09-30.08:34:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1632990870.74.0.972550641959.issue45323@roundup.psfhosted.org>
In-reply-to
Content
I obtain the reported behaviour using `python -m doctests <presentation>.md` in a Gitlab pipeline, so it is likely that the execution is similar to the Python interpreter.

Therefore, I am satisfied by your answer, so I close this 'bug'; thanks a lot!

Now, about the fact that `x` is assigned when matched even if "guarded-out" afterwards: this is exposed in the tutorial, so I consider this to be the expected behavior; see last sentence of https://www.python.org/dev/peps/pep-0636/#adding-conditions-to-patterns.

Note: I discovered the observed behavior while writing a presentation, sourced in a markdown file and then rendered as a RevealJS presentation, visible here (French): https://poles.pages.forge.kaizen-solutions.net/pole-python/pr-sentations/python-structural-pattern-matching.
History
Date User Action Args
2021-09-30 08:34:31ojobsetrecipients: + ojob, steven.daprano
2021-09-30 08:34:30ojobsetmessageid: <1632990870.74.0.972550641959.issue45323@roundup.psfhosted.org>
2021-09-30 08:34:30ojoblinkissue45323 messages
2021-09-30 08:34:30ojobcreate