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 josh.r
Recipients josh.r, tanzer@swing.co.at
Date 2015-10-23.02:45:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1445568351.65.0.457397089649.issue25457@psf.upfronthosting.co.za>
In-reply-to
Content
The Python 2 sort order is a result of the "arbitrary but consistent fallback comparison" (omitting details, it's comparing the names of the types), thus the "strange" sort order. Python 3 (justifiably) said that incomparable types should be incomparable rather than silently behaving in non-intuitive ways, hiding errors.

Python is being rather generous by allowing non-string keys, because the  JSON spec ( http://json.org/ ) only allows the keys ("names" in JSON parlance) to be strings. So you're already a bit in the weeds as far as compliant JSON goes if you have non-string keys.

Since mixed type keys lack meaningful sort order, I'm not sure it's wrong to reject attempts to sort them. Converting to string is as arbitrary and full of potential for silently incorrect comparisons as the Python 2 behavior, and reintroducing it seems like a bad idea.
History
Date User Action Args
2015-10-23 02:45:51josh.rsetrecipients: + josh.r, tanzer@swing.co.at
2015-10-23 02:45:51josh.rsetmessageid: <1445568351.65.0.457397089649.issue25457@psf.upfronthosting.co.za>
2015-10-23 02:45:51josh.rlinkissue25457 messages
2015-10-23 02:45:50josh.rcreate