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 gvanrossum
Recipients gregory.p.smith, gvanrossum, lys.nikolaou, pablogsal, rhettinger, serhiy.storchaka, slebedev
Date 2021-12-24.01:01:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1640307681.52.0.90578840299.issue46167@roundup.psfhosted.org>
In-reply-to
Content
We managed to do this for 'with' so it should be possible here too, I'd think. The "committing" token would be the newline following the close parenthesis.

Serhiy: the benefit is when you want to split it across two lines, e.g.

assert (a_very_long_condition(),
        "A Very Long Message")

I know you can do this using backslash, e..

assert a_very_long_condition(), \
        "A Very Long Message"

but there's a strong cultural rejection of backslash for line splitting (it's in PEP 8 and engrained in many people's brains) and it's just so natural to use parentheses -- they work for 'import', 'with', function calls, 'if', etc.
History
Date User Action Args
2021-12-24 01:01:21gvanrossumsetrecipients: + gvanrossum, rhettinger, gregory.p.smith, serhiy.storchaka, lys.nikolaou, pablogsal, slebedev
2021-12-24 01:01:21gvanrossumsetmessageid: <1640307681.52.0.90578840299.issue46167@roundup.psfhosted.org>
2021-12-24 01:01:21gvanrossumlinkissue46167 messages
2021-12-24 01:01:21gvanrossumcreate