Message326637
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. |
|
Date |
User |
Action |
Args |
2018-09-28 13:50:45 | lukasz.langa | set | recipients:
+ 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:45 | lukasz.langa | set | messageid: <1538142645.37.0.545547206417.issue12782@psf.upfronthosting.co.za> |
2018-09-28 13:50:45 | lukasz.langa | link | issue12782 messages |
2018-09-28 13:50:45 | lukasz.langa | create | |
|