operator.__cmp__
Erik Max Francis
max at alcyone.com
Wed Dec 4 17:44:37 EST 2002
Antoon Pardon wrote:
> I still find it a bit inconsistent to have 'cmp' as a builtin and
> 'add' as a function from a module while 'lt' is completly missing.
> I think it would have been better if all associated methods for
> implemeting operators had cousin functions that could be found
> in one single place.
In 2.2.x, at least, there certainly is an operator.__lt__:
>>> import operator
>>> operator.__lt__
<built-in function __lt__>
>>> operator.__lt__(1, 2)
1
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ The little I know, I owe to my ignorance.
\__/ Sacha Guitry
Polly Wanna Cracka? / http://www.pollywannacracka.com/
The Internet resource for interracial relationships.
More information about the Python-list
mailing list