[issue18111] Add a default argument to min & max

Julian Berman report at bugs.python.org
Tue Jun 4 03:48:01 CEST 2013


Julian Berman added the comment:

Raymond, I respect that in your opinion this seems to be overcomplexity, but you haven't addressed any of the arguments made, nor responded to any of the arguments against this being added complexity.

I really don't understand the parallels you're making to str.*with, but as for other languages, as David pointed out already, you are looking at things in a vacuum. This is needed because min and max are already silly. In languages like Ruby and Clojure, which were the quickest I had handy, of course you don't need this, because calling min and max *by default* returns None. I'd bet Python 2's silly type comparison history had something to do with the return value not defaulting to None, but what's done is done. I don't like hard-fast rules, but I don't think APIs should ever be penalized for their own mistakes. We should make sane things possible in pleasant ways.

If it's OK then (turning back to the patch), unless anyone has something additional to add I'm going to carve up some tests.

----------

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


More information about the Python-bugs-list mailing list