Augument assignment versus regular assignment

Antoon Pardon apardon at forel.vub.ac.be
Thu Jul 20 06:13:57 EDT 2006


On 2006-07-19, Terry Reedy <tjreedy at udel.edu> wrote:
>
> "Antoon Pardon" <apardon at forel.vub.ac.be> wrote in message 
> news:slrnebs290.ivs.apardon at rcpc42.vub.ac.be...

>> So IMV those preparation before the attachment, belong to
>> whatever the interpreter does before it actually attaches
>> an object to a name/slot.
>>
>> So the evaluation of the target is part of what is done by
>> STORE_SUBSCR or __setitem__.
>>
>> Now you can object to the fact that I have divided the work
>> within an opcode.
>
> But I won't.  The amount of duplication that can be factored out with 
> augmented assignment depends on the granularity of operations.

I can agree with that. But until now each time I tried to
suggest that the STORE_SUBSCR or __setitem__ are involved
in the evaluation of the target, I was told I shouldn't
look at things that way. 

> And the 
> granularity of operations depends on the interpreter.  Hence my claim that 
> the details are necessarily interpreter dependent.

Well my impression from reading the language reference is that
it suggests that a greater amount of duplication is factored out
than the granularity of the CPython implementation allows.

But since you already agreed that there is room for improvement
in the augmented assignment reference I will leave it at that.

I would like to thank everybody for their contributions, but I
think everything worth while has been said, so I will no longer
contribute to this thread.

-- 
Antoon Pardon



More information about the Python-list mailing list