From: spamfranke at bigfoot.de (Stefan Franke)
Date: Wed, 12 May 1999 15:55:17 GMT
Subject: while (a=b()) ...
References: <XFMail.990429164839.nathan@islanddata.com> <7h4mq2$675$1@holly.csv.warwick.ac.uk> <slrn7jbpbi.rao.scott@chronis.pobox.com> <3736ED9B.515704AF@starmedia.net> <slrn7je3v3.v7t.scott@chronis.pobox.com> <7ha231$hsb$1@nnrp1.deja.com> <37397620.9887F8B4@infercor.no> <paulb@infercor.no> <199905121351.OAA11436@lsls4k.lsl>
Message-ID: <373aa357.20071911@news.omnilink.de>
X-UID: 1946                                                 

>Paul Boddie <paulb at infercor.no> wrote:
> Of course, the "while 1" is a bit "ugly", but then it merely causes the
> reader to go looking for the exit points. We could change that to a
> single keyword acting as a synonym if it really bothered a significant
> number of people, but I don't see too much of a need for that.

I would even go further: The use of "while 1:" as a substitute for other control
structures outnumbers its use for endless loops *by far* (at least 20:1 in the
standard libs, as a quick grep shows).

So IMO this idiom should be taught as early as possible, Unluckily the Python
tutorial mentions "while 1:" only three times: Two times for endless loops, one
time to demonstrate syntax errors...

Stefan





