Steven D'Aprano added the comment:

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)).

----------
nosy: +steven.daprano

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22979>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to