我從蟒蛇無獲悉:爲什麼None在Python中最小?
None is frequently used to represent the absence of a value
當我把一個列表,並以數字和字符串排序。我得到了以下結果,這意味着它是最小的數字?
反向:
>>> sorted([1, 2, None, 4.5, (-sys.maxint - 1), (sys.maxint - 1), 'abc'], reverse=True)
['abc', 9223372036854775806, 4.5, 2, 1, -9223372036854775808, None]
>>>
正常排序:
>>> sorted([1, 2, None, 4.5, (-sys.maxint - 1), (sys.maxint - 1), 'abc'])
[None, -9223372036854775808, 1, 2, 4.5, 9223372036854775806, 'abc']
>>>
蟒蛇如何排序的功能正在與無?
http://stackoverflow.com/questions/2214194/is-everything-greater-than-none – ndpu