A number smaller than negative infinity in python? [duplicate]
问题 This question already has answers here : Is everything greater than None? (2 answers) Closed last month . This is possible in python2: None < float('-inf') Also, it always returns True However, on python3, this throws TypeError: unorderable types: NoneType() < int() Why is None comparable to integers/floats with python2? Are there any benefits or applications to None being orderable in python2? 回答1: First of all Python 2 allowed comparing all types of mixed types. This wart was fixed in