The rap against "while True:" loops

Mensanator mensanator at aol.com
Wed Oct 14 18:34:28 CEST 2009


On Oct 14, 2:19�am, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
> On Tue, 13 Oct 2009 15:02:09 -0700 (PDT), Mensanator
> <mensana... at aol.com> declaimed the following in
> gmane.comp.python.general:
>
> > You're not getting away that easy.
>
> > What's YOUR opinion of "whilr True"?
>
> � � � � Uhm... that it isn't valid in any language having English influence
> upon it's keywords...

Duh. You DO know that 'r' is next to 'e' on the
keyboard?

>
> � � � � If anything -- I'd suggest a proposal to add a plain � �loop � �as a
> keyword in Python, whose effect is equivalent to a "while True", but a
> break � �must be used to exit said loop (well, we'll ignore raising an
> exception <G>)

And what will that accomplish? The problem isn't
using while True, it's the fact that you are
escaping the loop. Best Practice is to EXIT the
loop properly, not escape from it.

> --
> � � � � Wulfraed � � � � Dennis Lee Bieber � � � � � � � KD6MOG
> � � � � wlfr... at ix.netcom.com � � HTTP://wlfraed.home.netcom.com/




More information about the Python-list mailing list