On Sat, 19 May 2018, Greg Ewing wrote:
Chris Angelico wrote:
The 'as' syntax has been hammered out in great detail and is no longer
recommended due to its negative interactions with existing constructs.
Allowing it in arbitrary expressions has been ruled out on
the grounds that the difference between "with x as y:" and
"with (x as y):" would be too subtle.
I don't quite get what's so subtle about it, am I missing something?
The "with" keyword calls "__enter__", and "as" gives it a name.
Just like "-x + y" is different from "-(x + y)",
each part does it's thing, and you control the order with parens.
/Paul
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/