[Python-Dev] Re: PEP 326 (quick location possibility)

David Eppstein eppstein at ics.uci.edu
Tue Jan 27 18:39:06 EST 2004


In article <20040126164752.FBFB.JCARLSON at uci.edu>,
 Josiah Carlson <jcarlson at uci.edu> wrote:

> A few people have suggested that the Max and Min objects be available as
> the result of calls to max() and min(), this would solve the location
> and name problem, and shouldn't break any old code.

I would probably use min() and max() over 
someobscuremodule.UniversalLowerBoundObject and 
someobscuremodule.UniversalUpperBoundObject.  I very much like the idea 
of PEP 326 (making proper universal min and max objects instead of 
encouraging those of us who know about it to use None or forcing us to 
make half-working versions ourselves), and I feel strongly that (if 
something like PEP 326 is accepted) min() and max() should return the 
Min and Max objects, as should min([]) and max([]).

All that said, I don't think making the actual names of these objects be 
min() and max() would lead to the most readable code, and I'm still 
hopeful that more readable names can be found.

Smallest and Largest, maybe?

-- 
David Eppstein                      http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science




More information about the Python-Dev mailing list