"Suresh Jeevanandam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > Is there any gain in performance because of augmented assignments. > > x += 1 vs x = x+1 > > Or are both of them the same.
The main gain is in programmer performance for writing a long name such as number_of_items once instead of twice. Also in reading to see that the same name gets rebound to the new name. Program performance might be noticeable if 'x' is something like a.b.c.d that takes some lookup time. But again, I would use the += form for readability without testing run time. Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list