This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients Electro, akira, mark.dickinson, rhettinger
Date 2014-06-27.18:39:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1403894357.47.0.881181487866.issue21873@psf.upfronthosting.co.za>
In-reply-to
Content
FWIW, the logic for tuple ordering is a bit weird due to rich comparisons.   Each pair of elements is first checked for equality (__eq__).  Only if the equality comparison returns False does it call the relevant ordering operations (such as __lt__).   The docs get it right, "If not equal, the sequences are ordered the same as their first differing elements."

In short tuple ordering is different from scalar ordering because it always makes equality tests:
 
   a < b              calls           a.__lt__(b)

in contrast:

   (a, b) < (c, d)    is more like:   if a != c:  return a < c ...
History
Date User Action Args
2014-06-27 18:39:17rhettingersetrecipients: + rhettinger, mark.dickinson, akira, Electro
2014-06-27 18:39:17rhettingersetmessageid: <1403894357.47.0.881181487866.issue21873@psf.upfronthosting.co.za>
2014-06-27 18:39:17rhettingerlinkissue21873 messages
2014-06-27 18:39:17rhettingercreate