sorting a dictionary

Erik Max Francis max at alcyone.com
Wed Feb 5 21:24:30 EST 2003


Alex Martelli wrote:

> you CAN compare a complex number to a string -- just not to
> any other number.  Now, that is a "feature" I'm not going to
> try to defend (can anybody think of a GOOD reason, as opposed
> to an implementation detail leaking out...?).

It's a tip of the hat to the mathematical fact that comparisons between
complex numbers is undefined.  I agree that in light of Python's
generality of comparisons, it's a little weird to restrict the case
where a complex number is being compared to another numeric value, but
to someone with a mathematics background the reason is obvious.  I've
never understood why this "feature" generates such discord.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Does the true light / Of love come in flashes
\__/ Sandra St. Victor
    Rules for Buh / http://www.alcyone.com/max/projects/cards/buh.html
 The official rules to the betting card game, Buh.




More information about the Python-list mailing list