[PYTHON MATRIX-SIG] Re: Conversion

Guido van Rossum guido@CNRI.Reston.Va.US
Mon, 31 Mar 1997 22:23:50 -0500


> Guido writes:
> ...
> > > Looking at the source, I see that complex numbers have a 3rd
> > > data attribute, "conj", which returns the same as the .conjugate()
> > > method. I don't like this very much (because there's already the
> > > method, and because it really isn't a "component" of the complex
> > > number like its real and imag components are) but am afraid to
> > > remove it out of fear of breaking anything.  Am I overly worried?

Tim Peters replies:

> > I'll yield to Jim & the Matrix folks on that -- I didn't know even know 
> > .conj existed, and agree that "it shouldn't".

Jum Hugunin:

> In my opinion, .conj shouldn't exist.  I tried to get Konrad to take it out 
> at some early point in the development of complexobject.c.  I wouldn't 
> worry about breaking anything, but I'm cross-posting to the matrix-sig to 
> give others a chance to shout if you'll be breaking their code.

OK, I'll take .conj out unless I hear from you again.

> Note: for NumPy arrays there is neither a ".conj" attribute nor a 
> ".conjugate()" method.  Instead there is a "conjugate(a)" function which 
> will work on any number-like python object in the right manner.  There 
> seemed to be agreement within the SIG that this function is what everybody 
> really wanted anyway.

I have a feeling that for orthogonality, conjugate() should have to be
a built-in function (like abs()); and that there should be some other
built-in function (angle()?) that returns ``the other polar
coordinate'' so that (abs(z), angle(z)) are an alternate
representation of z.  But you can tell that I'm not a complex number
expert :-)

--Guido van Rossum (home page: http://www.python.org/~guido/)


_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________