why (1, 2, 3) > [1, 2, 3] is true?

Stefan Behnel stefan_ml at behnel.de
Thu Feb 25 15:54:58 CET 2010


fat bold cyclop, 25.02.2010 15:03:
>> Both are not equal, so the comparison returns an arbitrary result in Py2.
> Thanks, Stefan. If I understand you correctly the comparison is not
> valid.
> But I wonder if there is any logic behind this (in 2.x).
> Is it possible to predict result of this comparison?

The result is predictable, it's just arbitrary in that it does not depend
on the values that you are comparing but only on their type.

Stefan




More information about the Python-list mailing list