Jeff Schwab <[EMAIL PROTECTED]> wrote: > a += b > > Whether a refers to the same object before and after that statement > depends on what type of object it referred to before the statement. > Yes but the rule followed by the builtin types is pretty simple: if 'a' can still refer to the same object then it does.
Immutable objects make this impossible most of the time (unless 'b' is 0, (), or similar), and there may be other exceptions I've missed, but this is the general principle, so mutable objects will mutate and immutable objects won't. Whether the same rule is followed outside the core is, of course, up to the individual developers. -- http://mail.python.org/mailman/listinfo/python-list