Bob Ippolito (@etrepum) on Haskell, Python, Erlang, JavaScript, etc.
«

PEP 326 -- A Case for Top and Bottom Values

»

PEP 326 gets my vote, with one condition: change cmp.high and cmp.low! Why not just use max and min respectively? This follows the discussion Josiah Carlson and I had on his livejournal.

For the uninitiated, PEP 326 proposes that Python should have builtins that represent the smallest and largest possible object values regardless of object type. The smallest value will always return -1 for cmp unless it is compared with itself, in which case it returns 0. It's rather obvious what the largest value will do :)

blog comments powered by Disqus