[Python-ideas] [RFC] draft PEP: Dedicated infix operators for matrix multiplication and matrix power

Nathan Schneider nathan at cmu.edu
Fri Mar 14 17:39:21 CET 2014


On Fri, Mar 14, 2014 at 12:16 PM, Paul Moore <p.f.moore at gmail.com> wrote:

> On 14 March 2014 15:46, Zachary Ware <zachary.ware+pyideas at gmail.com>
> wrote:
> > I agree with Paul, @/@@ just look scary as operators.  Here's a few
> > multi-character options I've come up with that I would like to see
> > shot down in flames before @/@@ are added to Python:
>
> Just as a contrasting point, I've been reading this thread on gmail
> with a proportional font. I went and looked at the PEP in a fixed
> width font earlier, and the @ sign doesn't look anywhere near as bad
> there.
>
>
In Courier New:

    S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r)

Still looks kind of bulky to me, because @ is the height and width of a
capital letter. How about prefixing * with an innocuous backtick?

    S = (H `* beta - r).T `* inv(H `* V `* H.T) `* (H `* beta - r)

That way no part of the operator extends to the baseline, so identifiers
and parentheses/brackets are visually well-separated from this as they are
with most other binary operators.

Nathan


> Paul
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140314/88d86d95/attachment-0001.html>


More information about the Python-ideas mailing list