On Tue, 21 Feb 2006 10:55:42 +0530 Suresh Jeevanandam <[EMAIL PROTECTED]> wrote: > Is there any gain in performance because of > augmented assignments. > > x += 1 vs x = x+1
Yep. I perform better when I only type names once. Especially if they are long: length_of_object_I_must_describe_very_carefully += 1 vs length_of_object_I_must_describe_very_carefully = length_of_object_I_must_describe_very_carefully + 1 Oh, you mean performance of the computer? ;-) But Python is all about optimizing the performance of programmers, not computers! Seriously, I think they are usually equivalent internally, at least for immutable objects. -- Terry Hancock ([EMAIL PROTECTED]) Anansi Spaceworks http://www.AnansiSpaceworks.com -- http://mail.python.org/mailman/listinfo/python-list