[Python-ideas] Allow using ** twice

Steven D'Aprano steve at pearwood.info
Fri Jun 7 02:18:15 CEST 2013


On 07/06/13 05:56, Peter Jung wrote:

> I disagree. With
>
> C=A
> A+=B
>
> I'd expect A==C still to be true, whatever B would be.
> This is how all nonatomic types in python behave (the symbol is just a pointer) and a dict is not atomic by any means.

Strings are not atomic, nor are tuples:

py> a = ()
py> c = a
py> a += (1,)
py> a == c
False



The relevant distinction here is not atomic or nonatomic, but mutable or immutable.


-- 
Steven


More information about the Python-ideas mailing list