'1' + 1 ==> True ???

Peter Hansen peter at engcorp.com
Thu Mar 18 14:45:48 CET 2004


Nicola Mingotti wrote:
> This is all what i wanted to know . 
> Even if i can't see it's utility , at least
> for the behaviour of the comparison between strings
> and numbers with every string considered greater of every int .

One example of its utility: in a sort algorithm, you would want to be 
able to produce consistent orderings of items in a list, even if some of 
the items were strings, and others were integers.  (That may in fact be 
its _only_ utility, for all I know.)

-Peter



More information about the Python-list mailing list