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 jan.cespivo
Recipients jan.cespivo
Date 2020-07-28.07:59:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1595923177.97.0.806397891633.issue41417@roundup.psfhosted.org>
In-reply-to
Content
Hi,

it should be useful if assignment expression works within assertion.

For example (real use-case in tests):

assert r := re.match(r"result is (\d+)", tested_text)
assert int(r.group(1)) == expected_number

I haven't found a mention about assertions in https://www.python.org/dev/peps/pep-0572/ so it isn't technically a bug but it might be omission (?).

Thx!
History
Date User Action Args
2020-07-28 07:59:38jan.cespivosetrecipients: + jan.cespivo
2020-07-28 07:59:37jan.cespivosetmessageid: <1595923177.97.0.806397891633.issue41417@roundup.psfhosted.org>
2020-07-28 07:59:37jan.cespivolinkissue41417 messages
2020-07-28 07:59:37jan.cespivocreate