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 lukasz.langa
Recipients Julian, barry, benjamin.peterson, eric.araujo, ezio.melotti, georg.brandl, ishimoto, lukasz.langa, ncoghlan, r.david.murray, serhiy.storchaka, steven.daprano, ulope
Date 2018-09-28.13:50:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538142645.37.0.545547206417.issue12782@psf.upfronthosting.co.za>
In-reply-to
Content
This was closed without enough explanation. Suggesting people should use ExitStack due to a Python grammar deficiency is suboptimal to say the least.

This problem is coming back to users of Black due to Black's removal of backslashes. It's the only piece of our grammar where backslashes are required for readability which shows there's something wrong.

The syntax ambiguity that Nick is raising fortunately shouldn't be a problem because a single tuple is an invalid context manager. In other contexts if the organizational parentheses are matched by the with-statement and not by the underlying `test`, that's also fine since they were organizational this doesn't make the `test` invalid.

Pablo has a working patch for this, we intend to fix this wart for Python 3.8.
History
Date User Action Args
2018-09-28 13:50:45lukasz.langasetrecipients: + lukasz.langa, barry, georg.brandl, ishimoto, ncoghlan, benjamin.peterson, ezio.melotti, eric.araujo, steven.daprano, r.david.murray, Julian, serhiy.storchaka, ulope
2018-09-28 13:50:45lukasz.langasetmessageid: <1538142645.37.0.545547206417.issue12782@psf.upfronthosting.co.za>
2018-09-28 13:50:45lukasz.langalinkissue12782 messages
2018-09-28 13:50:45lukasz.langacreate