while True or while 1

Krister Svanlund krister.svanlund at gmail.com
Sun Dec 12 10:33:41 EST 2010


On Sun, Dec 12, 2010 at 3:14 PM, Max Countryman <maxc at me.com> wrote:
> I'm sure this has been brought up many times, but a quick Googling didn't yield the decisive results I was hoping for, so I apologize if this has already been addressed in great detail somewhere else.
>
> I am wondering what the rationale is behind preferring while True over while 1? For me, it seems that using True provides more clarity, but is that the only benefit? Is while 1 more prone to errors?

It's just silly to use 1 since it will evaluate to True either way.



More information about the Python-list mailing list