Relax Syntax for Augmented Arithmetic?

Steve Holden steve at holdenweb.com
Sat Jan 24 03:58:40 EST 2009


Aahz wrote:
> In article <mailman.7801.1232715276.3487.python-list at python.org>,
> Steve Holden  <steve at holdenweb.com> wrote:
>> I understand what you are saying, but if the id() associated with a name
>> doesn't change after augmented assignment it seems a little wrong-headed
>> to argue that "the augmented assignment always binds a new value to the
>> name".
>>
>> What you are actually saying is that it's up to the method that
>> implements the augmented assignment whether the same (mutated) object or
>> a different one is returned, right? And that the left-hand side of the
>> assignment is always bound to the result of that method.
> 
> That's overall more correct, but I wanted to emphasize that there is
> *always* a binding operation being performed.  Whether what gets bound to
> the target is a new object or an existing object is up to the augmented
> assignment method.

<nods>

Yes, we're on the same page. Maybe I was being too pedantic ...

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list