This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients Brian.Mearns, r.david.murray, simeon.visser, steven.daprano
Date 2014-12-13.04:06:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1418443597.85.0.717851476877.issue22979@psf.upfronthosting.co.za>
In-reply-to
Content
Even though I agree with closing this issue, there is some support for ignoring certain "missing values" when calculating min() and max(). The draft 2008 revision of IEEE-754 includes two functions maxNum and minNum which silently skip over NANs:

https://en.wikipedia.org/wiki/IEEE_754_revision#min_and_max

The R language also supports max and min skipping over missing values:

https://stat.ethz.ch/R-manual/R-devel/library/base/html/Extremes.html

The problem is that there are so many different things which somebody might want to do, it is hard to tell which (if any) the built-ins should support:

- silently skip over None
- or NANs
- or treat some other, user-specified, value as "missing"
- treat None as the smallest (or largest) value
- treat the presence of None as an error
- etc.

I think that min() and max() should continue to be relatively simple-minded and let users write their own more complex versions if needed, e.g. by calling min(filter(condition, values)).
History
Date User Action Args
2014-12-13 04:06:37steven.dapranosetrecipients: + steven.daprano, r.david.murray, simeon.visser, Brian.Mearns
2014-12-13 04:06:37steven.dapranosetmessageid: <1418443597.85.0.717851476877.issue22979@psf.upfronthosting.co.za>
2014-12-13 04:06:37steven.dapranolinkissue22979 messages
2014-12-13 04:06:37steven.dapranocreate