ditto for sorts [ ' 'sort(typeerrorunorderable typesstr(int( true str( >' ' >int(' '(truetruemixed numbers convert to highest type manual conversions force the issue python and dictionary comparisons the second-to-last point in the preceding section also merits illustration in python xdictionaries support magnitude comparisonsas though you were comparing sorted key/value listsc:\codec:\python \python {' ': ' ': {' ': ' ': = false true dictionary equality dictionary magnitude only as noted briefly in thoughmagnitude comparisons for dictionaries are removed in python because they incur too much overhead when equality is desired (equality uses an optimized scheme in that doesn' literally compare sorted keyvalue lists) :\codec:\python \python {' ': ' ': {' ': ' ': = false typeerrorunorderable typesdict(dict(the alternative in is to either write loops to compare values by keyor compare the sorted key/value lists manually--the items dictionary methods and sorted built-in sufficelist( items()[(' ' )(' ' )sorted( items()[(' ' )(' ' )sorted( items()sorted( items()true sorted( items()sorted( items()false magnitude test in this takes more codebut in practicemost programs requiring this behavior will develop more efficient ways to compare data in dictionaries than either this workaround or the original behavior in python core types review and summary