[Python-ideas] Have max and min functions ignore None

Nick Coghlan ncoghlan at gmail.com
Tue Dec 29 22:06:28 EST 2015


On 30 December 2015 at 12:21, Michael Selik <mike at selik.org> wrote:
> If None gets ignored, what about iterables that mix numbers and strings?

That's part of why I like Steven's suggestion of putting a capability
along these lines in the statistics module: that reduces the input
domain to numeric types, so the statistical analysis functions in
NumPy and Pandas and the data aggregation functions in SQL become
better behavioural guides. By contrast, the builtin min() and max()
work with arbitrary (potentially heterogeneous)  iterables, so special
casing None (or NaN) doesn't make sense the way it does in strictly
numerical analysis (or analysis with constrained types).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list