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

Nathaniel Smith njs at pobox.com
Fri Mar 14 18:12:12 CET 2014


On Fri, Mar 14, 2014 at 5:08 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Fri, 14 Mar 2014 16:46:27 +0000
> Robert Kern <robert.kern at gmail.com> wrote:
>> On 2014-03-14 16:39, Nathan Schneider wrote:
>>
>> > 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.
>>
>> Fails the grit-on-Tim's-monitor test, or at least the grit-on-Robert's-monitor test.
>
> Not only grit, but the problem with the backtick is that it can look
> very close to a straight apostrophe.

Backtick has in fact been formally banned from py3 by BDFL
pronouncement (for this reason):
   https://mail.python.org/pipermail/python-ideas/2007-January/000054.html
   http://legacy.python.org/dev/peps/pep-3099/

-- 
Nathaniel J. Smith
Postdoctoral researcher - Informatics - University of Edinburgh
http://vorpus.org


More information about the Python-ideas mailing list