Coding style

Boris Borcic bborcic at gmail.com
Wed Jul 19 05:53:02 EDT 2006


PTY wrote:
> Which is better?
> 
> lst = [1,2,3,4,5]
> 
> while lst:
>   lst.pop()
> 
> OR
> 
> while len(lst) > 0:
>   lst.pop()
> 

allways that either-or stuff ! And why did you not consider

while len(lst) : list.pop()

a neat middle ground, wouldn't you say ?

Cheers, BB
--
666 ?? - 666 ~ .666 ~ 2/3 ~ 1-1/3 ~ tertium  non datur ~ the excluded middle
              ~ "either with us, or against us" !!



More information about the Python-list mailing list