Message253360
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. |
|
Date |
User |
Action |
Args |
2015-10-23 02:45:51 | josh.r | set | recipients:
+ josh.r, tanzer@swing.co.at |
2015-10-23 02:45:51 | josh.r | set | messageid: <1445568351.65.0.457397089649.issue25457@psf.upfronthosting.co.za> |
2015-10-23 02:45:51 | josh.r | link | issue25457 messages |
2015-10-23 02:45:50 | josh.r | create | |
|