Łukasz Langa <luk...@langa.pl> added the comment:

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.

----------
nosy: +lukasz.langa
resolution: wont fix -> 
stage:  -> patch review
status: closed -> open
versions: +Python 3.8 -Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue12782>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to