[PYTHON MATRIX-SIG] Bug

Jim Hugunin hugunin@mit.edu
Thu, 24 Oct 1996 14:11:34 -0400


> > Not true at all.  It is important to be able to create rank-0 arrays in
> > order to do:
> > 
> > array_of_floats * array(3.14159, Float32)
> 
> True. So how about allowing rank-0 arrays only for the types which
> don't have scalar counterparts in Python, 

I also want to be able to write a * array(3.14, a.typecode()) sometimes, so
I need to be able to create them with any type.

> and disallowing any
> array-specific operations (especially indexing) on them, to make
> them act just like scalar types?

This sounds like a good idea in general.  The one problem here is that I do
want to provide some way to get the python value out of a scalar.  This is
currently done by scalar[0].  This could also be done by scalar.tolist() I
suppose.  I'd hate to add a special method just for this one highly unusual
operation.

-Jim

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

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