[Numpy-discussion] New Operators in Python

Anne Archibald peridot.faceted@gmail....
Sat Mar 24 16:14:04 CDT 2007


On 24/03/07, Charles R Harris <charlesr.harris@gmail.com> wrote:

> Yes indeed, this is an old complaint. Just having an infix operator would be
> an improvement:
>
> A dot B dot C
>
> Not that I am suggesting dot in this regard ;) In particular, it wouldn't
> parse without spaces. What about division? Matlab has both / and \ for left
> and right matrix division and something like that could call solve instead
> of inverse, leading to some efficiencies. We also have both dot and
> tensordot, which raises the problem of interpretation when ndim > 2.

There's always the Haskell approach: *every* function can be an infix
operator, just surround the name with backticks; functions with
line-noise names (like + * - /) are infix by default.

Not a good idea for python, I think.

Anne.


More information about the Numpy-discussion mailing list