How can I get the largest key in a dictionary which may have mixed data types? For example:
myDict = {1: 'foo', 2: 'bar', 3: None, 4: 1000}
I want to get the largest key which is 4. I tried max(myDict)
which does work, but is this always reliable? Or should I use max(myDict.keys())
instead?