[PYTHON MATRIX-SIG] inconsistency in array()?
Jim Hugunin
hugunin@mit.edu
Tue, 25 Feb 1997 14:30:44 -0500
Tom Short writes:
> >I hadn't checked out UserArray closely enough (I don't use it
personally).
> > Yours looks like a good improvement and if I don't hear any complaints
> >about it on the list, I'll adopt it into the next release.
>
> What is the purpose of UserArray? What does it allow that an Array
doesn't?
UserArray is a python class that behaves as much as possible like the lower
level array objects that are in C. The main advantage to UserArray is that
it can be subclassed to provide particular behaviors, while still behaving
as a normal array wherever possible.
The simplest example of the use of UserArray is the Matrix class that
behaves like the built-in array objects in most ways, but that reimplements
the multiply operation to do "real" matrix multiplies rather than the
normal element-wise multiplications.
I hope this answers your question - Jim
_______________
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________