while True or while 1

Dave Angel d at davea.name
Mon Jan 23 08:02:30 EST 2012


On 01/22/2012 10:55 PM, alex23 wrote:
> On Jan 23, 2:05 am, Dan Sommers<d... at tombstonezero.net>  wrote:
>> As per a now-ancient suggestion on this mailing list (I believe it was by
>> Tim Peters), I've also been known to use a non-empty, literal Python
>> string as a self-documenting, forever-True value in the typical loop-and-a-
>> half cnstruct:
>>
>>      while "the temperature is too big":
> I don't think I've ever encountered this before, but I like it :)
> Cheers!
I do something similar when there's a portion of code that should never 
be reached:

assert("reason why I cannot get here")



-- 

DaveA




More information about the Python-list mailing list