max(), sum(), next()

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Fri Sep 5 11:26:25 EDT 2008


David C. Ullrich:
> I didn't mention what's below because it doesn't seem
> likely that saying max([]) = -infinity and
> min([]) = +infinity is going to make the OP happy...

Well, it sounds cute having Neginfinite and Infinite as built-int
objects that can be compared to any other type and are < of or > of
everything else but themselves. Probably they can be useful as
sentinels, but in Python I nearly never use sentinels anymore, and
they can probably give some other problems...

Bye,
bearophile




More information about the Python-list mailing list