Scope rule pecularities

Terry Reedy tjreedy at udel.edu
Thu May 6 11:16:23 EDT 2004


"Antoon Pardon" <apardon at forel.vub.ac.be> wrote in message
news:slrnc9kilq.5fa.apardon at trout.vub.ac.be...
> Now I think I understand what is causing this, but I think this
> kind of thing shouldn't happen. If a += b is just syntatic sugar
> for a.__iadd__(b) then the first should be acceptable where the
> second is acceptable.

For immutables, a += b is better thought of as syntactic sugar for a = a+b.

tjr







More information about the Python-list mailing list