comparison on list yields surprising result

Hendrik van Rooyen hendrik at microcorp.co.za
Sat Aug 29 09:36:38 CEST 2009


On Friday 28 August 2009 21:00:31 Dr. Phillip M. Feldman wrote:
> In [21]: x
> Out[21]: [1, 2, 3, 5]
>
> In [22]: x>6
> Out[22]: True
>
> Is this a bug?

No, it is a feature, so that you can use sorted on this:

[[1,2,3,4,5],6]

- Hendrik



More information about the Python-list mailing list