max() of a list of tuples

Erik Max Francis max at alcyone.com
Tue Jan 21 23:30:12 EST 2003


Martin Maney wrote:

> Why not (None,None,None) as the initial value?

You're guaranteed that in any given implementation, the ordering of None
and numerics will be consistent, but you've no guarantee which will be
bigger.  If None < -1e16 on your implementation, that's just a lucky
conicidence; the interpreter would legitimately have None > -1e16.

It's an implementation defined area, and as such, your program shouldn't
rely on it if you want portability.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ I love Mickey Mouse more than any woman I've ever known.
\__/ Walt Disney
    HardScience.info / http://www.hardscience.info/
 The best hard science Web sites that the Web has to offer.




More information about the Python-list mailing list