[PYTHON MATRIX-SIG] In place ufuncs.

Jim Hugunin hugunin@mit.edu
Wed, 14 Aug 1996 12:54:15 -0400


tim@lassi.ece.uiuc.edu wrote:
> 
> What do people think of this?
> 
> Is there any possibility of having in-place ufuncs (analagous to *=,
> +=, etc.). This seems like it might be both faster and save some space
> where its usefull. Something like unfunc.inplace(a,b).
> 
> Usefull? Usefull? Hard? Trivial?

Trivial (you can have them now), but I refuse to document it because to
me it looks really ugly.  When python supports *=, etc. I'll be sure
that array objects support that properly (all that will take is somebody
contributing a clean set of patches to Guido).

If you really want inplace functions, try this:
>>> a = arange(3)
>>> add(a, 10, a)
10 11 12
>>> a
10 11 12

-Jim

=================
MATRIX-SIG  - SIG on Matrix Math for Python

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