The rap against "while True:" loops

Rhodri James rhodri at wildebst.demon.co.uk
Wed Oct 14 00:38:56 CEST 2009


On Tue, 13 Oct 2009 22:59:04 +0100, Mensanator <mensanator at aol.com> wrote:

> And I'm not saying John nor the OP should stop
> using what works for them. But there are certainly
> valid reasons for "don't use while True" to be
> on the "Best Practices" list.

Unfortunately, some of them seem to be reasons from
my point of view to put "*do* use while True" on the
"Best Practices" list.  Some of the constructs you
seem to like ring big alarm bells with me, because
I've found entirely too many bugs hidden by them.

> After all, how many times hve you put 'break'
> in a loop comprehension?

How many times have you written 20-line list
comprehensions?  If the answer is more than zero,
what on earth possessed you to think it was a
good idea? :-)

-- 
Rhodri James *-* Wildebeest Herder to the Masses



More information about the Python-list mailing list