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

Chris Angelico rosuav at gmail.com
Wed Apr 9 05:30:36 CEST 2014


On Wed, Apr 9, 2014 at 9:00 AM, Michael Mitchell
<epsilonmichael at gmail.com> wrote:
> I'm not sure why a composition operator has never been added to the
> functools library, but I'd make the observation that a composition function
> wouldn't be much less verbose than in my earlier lambda example. A infix
> binary operator, however, would be quite more concise, especially so when
> chaining multiple functions.

Is "a @ b" equivalent to "lambda x: a(b(x))" or to "lambda x:
b(a(x))"? Is there a sufficiently-obvious way to make it clear that
the one on the right gets called first?

ChrisA


More information about the Python-ideas mailing list