[Numpy-discussion] [IPython-dev] Discussion with Guido van Rossum and (hopefully) core python-dev on scientific Python and Python3
Henry Gomersall
heng@cantab....
Tue Feb 14 17:59:42 CST 2012
On Tue, 2012-02-14 at 15:12 -0800, Chris Barker wrote:
>
> On Tue, Feb 14, 2012 at 9:16 AM, Dag Sverre Seljebotn
> <d.s.seljebotn@astro.uio.no> wrote:
> > It was about the need for a dedicated matrix multiplication
> operator.
>
> has anyone proposed that? I do think we've had a proposal on the table
> for generally more operators: i.e. like matlab's ".*" vs "*", and yes,
> matrix multiplication would be one use of that feature.
One thing that would be nice would to be able to do something like:
a = H * b
mapping to something like
H.__new_mul__(b, a)
so that it's becomes possible to write to a pre-existing object, a. I'm
not sure how to syntatically deal with this. Perhaps a[:] = H * b could
carry that implicit connotation (with a fallback to create an interim
array). It's not exactly clean though.
Actually, having some syntax for any operation in which the left hand
side of the assignment is presented as an argument would allow some fun
things. Though i'm not sure how it makes sense if doesn't yet exist. I'm
sure someone can tell me why this is a really bad idea!
Cheers,
Henry
More information about the NumPy-Discussion
mailing list