None :)

Alex Martelli aleaxit at yahoo.com
Wed Apr 25 09:48:08 EDT 2001


"Hans Kristian Ruud" <hans at inenco.no> wrote in message
news:3AE6CBC8.B473F622 at inenco.no...
> When an element in a sequence s is None,
> max (s) will return None:
>
> >>> s = [1.4, 2.5, None, 4354549999L]
> >>> max(s)
> >>>
> >>> min(s)
> 1.4
>
> I could'nt find anything about this particular case
> in "Learning Python" by Lutz and Ascher. Nor in the FAQ.

Comparisons among objects of different types return
repeatable (within one run) but 'unpredictable' (a priori)
results.  On your implementation/platform/run, type
None seems to have returned 'greater' than numerics...
but you can't rely on that "in general"!


Alex






More information about the Python-list mailing list