[Python-ideas] Allow using ** twice

Devin Jeanpierre jeanpierreda at gmail.com
Thu Jun 6 20:51:54 CEST 2013


On Thu, Jun 6, 2013 at 2:36 PM, Andrew Barnert <abarnert at yahoo.com> wrote:
> That would make += misleading. In any other language with a += operator, it mutates. (And pure immutable languages don't have a += operator.) That's why we have __iadd__ and friends in the first place.

Can you name a language other than Python where `a += b` usually does
something different for mutable values from `a = a + b`, because of a
difference in how the + and += operators work w.r.t. if/how they
mutate their arguments? I can't think of any.

-- Devin


More information about the Python-ideas mailing list