Comparison of different types does not throw exception

Roy Smith roy at
Thu Jul 12 22:23:07 EDT 2001

Guido van Rossum <guido at> wrote:
> I haven't heard a peep from anyone who was bitten by the change in 2.1 
> where we disallow "<" etc. for complex numbers.

Although I guess it doesn't strictly make sense, I would assume a "<" 
operator applied to complex numbers would compare magnitudes.  The problem 
with that, I suppose, is that "<", "==", and ">" would not cover the entire 
space of value pairs.

> But then if we removed complex numbers, most folks wouldn't notice anyway

I must admit, I've never actually written any python code which uses 
complex numbers, but I still think their inclusion as a fundamental data 
type is one of the real (!) cool things about the language, and would 
lament their loss.  Takes me back to my fortran days, when I really did 
write that kind of code.

It is especially awesome that python uses the "correct" imaginary unit of 
j.  None of that i garbage the math weenies try to foist on us.

"We're sorry, you have reached an imaginary extension.  Please rotate your 
telephone 90 degrees and try your number again".

More information about the Python-list mailing list