Subclassing the min() build-in function?

Dennis Lee Bieber wlfraed at ix.netcom.com
Wed Nov 6 18:58:05 EST 2002


Bernhard Herzog fed this fish to the penguins on Wednesday 06 November 
2002 09:23 am:


> Your proposal woule mean that it returns the list which obviously is
> not backwards compatible.
>

>>> def safe_min(*arg):
...     return min(list(arg))
...
>>> safe_min(1,2,3)
1
>>> safe_min(2,1,3)
1
>>> safe_min(1)
1

-- 
--  
 > ============================================================== <
 >   wlfraed at ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed at dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >        Bestiaria Home Page: http://www.beastie.dm.net/         <
 >            Home Page: http://www.dm.net/~wulfraed/             <



More information about the Python-list mailing list