Tim> In 2.3, None compares less than anything else; Perhaps a stupid observation, but empty lists, dicts, strings and tuples appear to compare larger than any int or float: >>> lst = [(), [], {}, "", 1e308, sys.maxint, 0, -sys.maxint, -1e308, None] >>> lst.sort() >>> lst.reverse() >>> lst [(), '', [], {}, 1e+308, 2147483647, 0, -2147483647, -1e+308, None] >>> absmax = lst[0] >>> absmin = lst[-1] >>> print absmax () >>> print absmin None I realize this is implementation-dependent (and I'm sure Tim already knows all this stuff). People wanting absolute min and max objects could use something like the above to generate such stuff when needed. pep-326-not-really-needed-ly, y'rs, Skip
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4