Nasty typo in PEP 238 (revised)

Tim Hochberg tim.hochberg at ieee.org
Sat Jul 28 16:17:58 CEST 2001


"Tim Peters" <tim.one at home.com> wrote:

[CRUMPLE, SPINDLE, BEND, SNIP]
> Your examples had users explicitly passing complex
> inputs to functions.  I was talking about getting complex results out of
> functions when complex numbers are *not* passed to them (such as acos(2)).
> Division can never return a complex result unless given a complex input.
I
> see nothing surprising to anyone about complex-in, complex-out.  It's only
> non-complex-in, complex-out that Python currently shields users from (in
the
> absence of explicitly using cmath functions).  As I said, I think that's a
> benefit for the majority of users; I don't know whether Guido agrees.
[CLIP]

What is minorly irksome is that there is no core set of math functions that
will give you complex when necessary, but return floats when they can. Cmath
insists on always spitting out complex numbers regardless of the input. It's
only minorly irksome 'cause I just use NumPys math functions and they "do
the right thing"(TM).

-tim





More information about the Python-list mailing list