just curious

Erik Max Francis max at alcyone.com
Sat Sep 6 01:01:50 EDT 2003


Elaine Jackson wrote:

> Any deep reason for this, or "just because"? TIA.

It's because the augmented assignment operators, like +=, are supposed
to efficiently mutate objects when they have the opportunity (at least
for the builtin classes).  So a = a + b always creates a new object, but
a += b might just mutate a preexisting object if that option is
available.

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ The great floodgates of the wonder-world swung open.
\__/  Herman Melville




More information about the Python-list mailing list