[Numpy-discussion] New Operators in Python

Matthieu Brucher matthieu.brucher@gmail....
Sat Mar 24 15:41:45 CDT 2007


Hi,

I followed the discussion on the scipy ML, and I would advocate it as well.
I miss the dichotomy that is present in Matlab, and to have a similar degree
of freedom, it would be good to have it in the upcoming major release of
Python.

Matthieu

2007/3/24, Travis Oliphant <oliphant@ee.byu.edu>:
>
> Every so often the idea of new operators comes up because of the need to
> do both "matrix-multiplication" and element-by-element multiplication.
>
> I think this is one area where the current Python approach is not as
> nice because we have a limited set of operators to work with.
>
> One thing I wonder is if we are being vocal enough with the Python 3000
> crowd to try and get additional operators into the language itself.
>
> What if we could get a few new operators into the language to help us.
> If we don't ask for it, it certainly won't happen.
> My experience is that the difficulty of using the '*' operator for both
> matrix multiplication and element-by-element multiplication depending on
> the class of the object is not especially robust.  It makes it harder to
> write generic code, and we still haven't gotten everything completely
> right.
>
> It is somewhat workable as it stands, but I think it would be nicer if
> we could have some "meta" operator that allowed an alternative
> definition of major operators.   Something like @*  for example (just
> picking a character that is already used for decorators).
>
> I wonder if we should propose such a thing for Python 3000.
>
> -Travis
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070324/b7e8219a/attachment.html 


More information about the Numpy-discussion mailing list