On Feb 20, 2020, at 23:56, Alex Hall <alex.moj...@gmail.com> wrote:
> 
> This is a proposal for a new syntax where a comprehension is written as the 
> appropriate brackets containing a loop which can contain arbitrary statements.

What happens if there’s a yield expression (that isn’t just ignored and used as 
an expression statement)? Probably not too common inside comprehensions, but 
there’s no reason you can’t write `[(yield None) for _ in range(3)]` to gather 
the first three values sent into your generator—and there might be much more 
common uses that come up once comprehensions can contain arbitrarily complex 
expressions. Does this now just collect up three None values? Does it still 
accept sends from the caller of the generator function it’s embedded in? What 
if the generator function yields from a generator expression with a yield 
expression in it? For that matter, what does yield from inside a comprehension 
do?


_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/BN3NRNXWW7MTI6NLAQIKJKHHUMIJ24MO/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to