[Python-ideas] Should this be considered a bug?

Arnaud Delobelle arnodel at gmail.com
Sun Oct 30 23:40:05 CET 2011


On 30 October 2011 22:31, Nick Coghlan <ncoghlan at gmail.com> wrote:

> Commutativity is an important expected property for addition and
> multiplication. Even NumPy's arrays respect that by using those
> operations for the element-wise equivalents - they use a separate
> method for matrix multiplication (which is not commutative by
> definition).

The convention in mathematics is that addition is commutative but
there is no such assumption for multiplication.  In fact,
multiplicative notation is commonly used for the composition law of
non-commutative groups.

Is there an established convention in computer languages?

As for the commutativity of addition in python... well, string
concatenation is not generally considered commutative :)

-- 
Arnaud



More information about the Python-ideas mailing list