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

Steven D'Aprano steve at pearwood.info
Mon Mar 24 02:08:24 CET 2014


On Sun, Mar 23, 2014 at 03:51:24AM -0700, Devin Jeanpierre wrote:

> If you rename "matmul" to "compose" and "matpow" to something like
> "iterate" (except less confusing), then you've generalized the
> operators a little and given them more potential use cases.

-1

The dunder methods are typically named for the most common or 
typical use-case, not generalised or marginal ones e.g.:

+  __add__ not __concat__
*  __mul__  not __repeat__ or __repetition__
<  __lt__ not __subset__
&  __and__ not __ampersand__ or __conjunction__




-- 
Steven


More information about the Python-ideas mailing list