[docs] [issue9802] Document 'stability' of builtin min() and max()

Mark Dickinson report at bugs.python.org
Wed Sep 8 22:52:10 CEST 2010


Mark Dickinson <dickinsm at gmail.com> added the comment:

Thanks for the patch!

Comments:

(1) Shouldn't 'reverse=True' be omitted in the second doc addition?

(2) I'd also suggest adding a brief comment about what this means for distinct, but equal, objects;  otherwise it's not really obvious what the point of the doc addition is.

(3) As a matter of clarity, perhaps replace "this is" with "max(iterable, key=key) is", and similarly for min.

As an aside, I still like Jeffrey Yasskin's suggestion on the python-dev mailing list that the sensible definition for max would maintain the invariant that max(iterable) be equivalent to sorted(iterable)[-1];  see Alexander Stepanov's writings in e.g., http://www.cs.rpi.edu/~musser/gsd/notes-on-programming-2006-10-13.pdf for more.  But that's (a) another issue, and (b) perhaps not a significant enough benefit to be worth changing Python's semantics for.

----------
nosy: +jyasskin, mark.dickinson, rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9802>
_______________________________________


More information about the docs mailing list