Python dot-equals (syntax proposal)

Terry Reedy tjreedy at udel.edu
Sun May 2 04:04:11 EDT 2010


On 5/2/2010 1:05 AM, Alf P. Steinbach wrote:
> On 02.05.2010 06:06, * Aahz:

>> and sometimes
>> they rebind the original target to the same object.
>
> At the Python level that seems to be an undetectable null-operation.

If you try t=(1,2,3); t[1]+=3, if very much matters that a rebind occurs.

> Granted one could see something going on in a machine code or byte code
> debugger. But making that distinction (doing nothing versus
> self-assignment) at the Python level seems, to me, to be meaningless.

Please do not confuse things. Augmented *assignment* must be understood 
as assignment. Failure to do so leads (and has lead) newbies into 
confusion, and puzzled posts on this list.

Terry Jan Reedy




More information about the Python-list mailing list