[SciPy-user] matrix mult operator

dmitrey openopt@ukr....
Mon Jun 25 13:17:28 CDT 2007

Robert Kern wrote:
> dmitrey wrote:
>> what about an operator, something like !* or *!
>> def evalF(A,B,C, D):
>>     return A !* (B !* C).T !* D + C !* (D !* B).T * A
>> it's much more readable.
>> Of course, you can wait till Python will support unicode, but as for me 
>> I would prefere not to wait so long.
> We do not control the Python language. We cannot add operators to the language.
> FWIW, the support of Unicode identifiers that is coming in 3.0 still won't allow
> you to define new operators.
Hmm... so it cannot be defined anything like
numpy.array operator !* (numpy.array):
    return (matrix multiplication)

But so many languages allow the trick! Even so ancient ones as (from my 
point of view) C/C++
It makes me very disappointed in Python, along with absence of 'switch' 
equivalent (I wonder why it's not implemented yet?..).

More information about the SciPy-user mailing list