How does compare work?
Aahz
aahz at pythoncraft.com
Tue Jan 27 12:58:41 EST 2004
In article <4016A368.9050806 at skynet.be>,
Helmut Jarausch <jarausch at skynet.be> wrote:
>
>First let me say that IMHO this is a big misdesign of Python.
Guido has come around to this POV. However, being able to compare
different types does have some defensibility. Your example of an ``if``
isn't directly relevant; what's more important is the question of
sorting a list containing arbitrary information. This is particularly
true for the case of something like extracting keys from a dict -- you
don't want an exception raised.
What may well happen is that sort comparisons get a different set of
special methods than relational operators.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"The joy of coding Python should be in seeing short, concise, readable
classes that express a lot of action in a small amount of clear code --
not in reams of trivial code that bores the reader to death." --GvR
More information about the Python-list
mailing list