[Python-Dev] Re: PEP239 (Rational Numbers) Reference Implementation and new issues

Paul F Dubois paul@pfdubois.com
Sun, 6 Oct 2002 09:14:01 -0700


The question was raised as to why the Numeric community really wanted
the literal notation 1.0+2.0j for complex numbers.

The motivation was not speed particularly; nobody is going to construct
a large complex array out of literals. It is true that inside a loop a
constant might be a problem but you could always lift it by hand. I'd
say rather that the real motivation was ease of learning for those who
knew similar languages. There were essentially three ways this was done
in other languages that our users would already grok:

(1.0, 2.0) -- Fortran; a non-starter for Python
1.0 + 2.0i or 1.0 + 2.0j -- most (all?) existing tools for similar
purposes use one of these. 

We all felt that Python would be perceived as "inferior" to these other
programs if you had to do something clumsy.

I haven't followed the rational discussion but obviously there is no
other long-standing and highly used notation for rationals except
1.0/2.0, is there?