One last shot at the Augmented Assignment PEP

Grant Edwards nobody at nowhere.nohow
Thu Sep 14 16:45:24 EDT 2000


In article <39C13378.4FEE433 at holdenweb.com>, Steve Holden wrote:
>Grant Edwards wrote:

>> I suppose if you really want assignment you can do it explicitly with the
>> old syntax.  If you know that you really want mutation, you can use the
>> method call to make it explicit. That way you get the proper error if you
>> try to mutate an immutable object.
>
>Well, doing it explicitly with the old syntax is going to be my solution of
>choice.  But then I've already confessed to being a bear of very little
>brain.  I just hope the documentation makes it quite clear, both to newbies
>and C/C++ programmers, that the semantics of the new augmented assignment
>operators are not equivalent to the "old syntax".

That's the problem: in order to explicitly do one or the other, you've got
to understand that there are two different ways to interpret "a += b".  I'm
wondering whether it will even occur to a new Python convert that "a += b"
might behave differently than "a = a + b".  OTOH, it may take a log time to
stumble across a case where the difference matters.

-- 
Grant Edwards                   grante             Yow!  ... I think I'm
                                  at               having an overnight
                               visi.com            sensation right now!!



More information about the Python-list mailing list