On Wed, 17 Oct 2007 23:46:25 +0000, Debajit Adhikary wrote:

> On Oct 17, 5:40 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
>> To answer your question though: a += b is *not* the same as a = a + b.
>> The latter would create a new list and assign it to a, whereas a += b
>> updates a in-place.
> 
> I know I'm being a little finicky here, but how would someone know that
> a+=b is not the same as a=a+b?
> Any documentation or reference that mentions this?

Have you Read The Fine Manual at the Fine Website?

Try typing "Python documentation" into your favourite search engine, or 
try going to http://www.python.org/ which links directly to
http://www.python.org/doc/

Unfortunately, searching for operators is always tricky (try searching 
for "*" some day...) but the section you want is here:

http://docs.python.org/ref/augassign.html


Also, it isn't always true that a += b is not the same as a = a+b. It 
depends on what a and b are.


-- 
Steven.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to