Thanks, this is what I was looking for and couldn't find. I'm glad it is
something that's been considered and debated before. I'm not sure why I
couldn't find it or anything like it, but I guess the syntax is just a
needle in a haystack.
Em
On Sat, May 2, 2020 at 7:42 AM Henk-Jaap Wagenaar <
wage
We seem to be, once again, rehashing about this. For example, I proposed
this in 2017, which was not the first time:
https://mail.python.org/archives/list/python-id...@python.org/thread/GFZFJAI4WGFYFFVQTF7DORHMY7F45XZZ/
(Gary's suggestion, and (counter) counter points to it are in the linked
dis
On 5/1/20 9:19 AM, silverback...@gmail.com wrote:
I hope this isn't too noobish, nothing on the list comes up in Google,
but I'm curious why the construct
for x in y if x.is_some_thing:
# do a thing
But this is probably clearer (and has the same syntax):
for x in y:
if x.is_some_thing:
Questions like this are best asked on python-ideas.
Specifically, though, you can get the same result with:
for x in (n for n in y if n.is_some_thing):
without requiring new syntax.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe