Nick Coghlan wrote:

In reviewing Zbyszek's doc updates and comparing them against the Grammar, I
discovered a gratuitous change in the implementation: it allows a bare (i.e. no
parentheses) 'yield from' as an argument to a function.

I'll add a new test to ensure "yield from x" requires parentheses whenever
"yield x" requires them (and fix the Grammar file on the implementation branch
accordingly).

Wait a minute, there's nothing in the PEP as accepted that
mentions any such restriction.

My intention was that it should be as easy as possible to
replace any function call 'f(x)' with 'yield from f(x)'.
If parentheses are required, then instead of

   f(yield from g(x))

we would have to write

   f((yield from g(x)))

I can't see how this is an improvement in readability or
clarity.

--
Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to