[prev in list] [next in list] [prev in thread] [next in thread]
List: python-ideas
Subject: Re: [Python-ideas] Generator syntax hooks?
From: Markus Meskanen <markusmeskanen () gmail ! com>
Date: 2017-08-11 20:08:37
Message-ID: CAJAvhDYEtiV9Z0TktbDn1ugbiMO5tVmZ421nAbvzgY3hsVs0KA () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Though I still dop'nt think using "while" would really introduce that much
confusion -- sure, it doesn't introduce a new loop, but, as someone pointed
out earlier in this thread it really is only changing from a:
"while do"
to a
"do while"
construct -- so means pretty much the same thing.
+1 for the "while" from me too, I don't think most people would find it
confusing (supposing they don't find current [x for x in foo if ...]
confusing either), and introducing a break there is just more of a mess.
To those who say that it might get ugly if you do something like:
[x for y in foo for x in y while x != y if x + y < 100]
This still isn't even unbearable, and once it gets that hard, maybe you
should consider something else anyways.
[Attachment #5 (text/html)]
<div dir="auto"><div class="gmail_extra" dir="auto"><div \
class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div \
class="gmail_extra"><div class="gmail_quote"><div>Though I still dop'nt think \
using "while" would really introduce that much confusion -- sure, it \
doesn't introduce a new loop, but, as someone pointed out earlier in this thread \
it really is only changing from a:<br></div><div><br></div><div>"while \
do"</div><div><br></div><div>to a</div><div><br></div><div>"do \
while"</div><div><br></div><div>construct -- so means pretty much the same \
thing.</div></div></div></div></blockquote></div></div><div dir="auto"><br></div><div \
dir="auto">+1 for the "while" from me too, I don't think most people \
would find it confusing (supposing they don't find current [x for x in foo if \
...] confusing either), and introducing a break there is just more of a \
mess.</div><div dir="auto"><br></div><div dir="auto">To those who say that it might \
get ugly if you do something like:</div><div dir="auto"><br></div><div dir="auto"> \
[x for y in foo for x in y while x != y if x + y < 100]</div><div \
dir="auto"><br></div><div dir="auto">This still isn't even unbearable, and once \
it gets that hard, maybe you should consider something else anyways.</div><div \
class="gmail_extra" dir="auto"></div></div>
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic