[Python-ideas] "While" suggestion

Stavros Korokithakis stavros at korokithakis.net
Thu Jul 3 22:22:56 CEST 2008


I don't know where this "while True" concept snuck in, the proposal 
isn't supposed to replace those, it's supposed to replace this:

<setup>
while <expression>"
     <stuff>
     <setup>

Stavros

Steven Bethard wrote:
> On Thu, Jul 3, 2008 at 11:11 AM, Torsten Bronger
> <bronger at physik.rwth-aachen.de> wrote:
>>> 2008/7/3 Stavros Korokithakis
>>> <stavros at korokithakis.net>:
>>>
>>>> while my_file.read(1024) as data:
>>>>   do_something(data)
>> I don't like it.  Taken as an English expression, it suggests
>> something misleading.  I looked at my own code (not much; 15.000
>> lines) and found three "while True", and none of them could be
>> expressed with "while ... as ...".  It is not worth it in my
>> opinion.
> 
> I had similar results. Around 10 "while True" constructs, and none of
> them would have worked with "while ... as ..."
> 
> -1 for me.
> 
> Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stavros.vcf
Type: text/x-vcard
Size: 143 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20080703/cfaf9662/attachment.vcf>


More information about the Python-ideas mailing list