Augmented Assignment question

Aahz aahz at pythoncraft.com
Wed Jul 16 16:51:38 EDT 2003


In article <215bhv0bnkn13eivh0s64ic5ml8obpgfg7 at 4ax.com>,
Doug Tolton  <dtolton at yahoo.com> wrote:
>
>I did some reading and it seems that an augmented assignment is
>specifically verboten on tuples and lists.  Is there a clean way to
>accomplish this?  

Really?

>>> l = []
>>> l+=[1]
>>> l
[1]
>>> l+=['foo']
>>> l
[1, 'foo']
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

A: No.
Q: Is top-posting okay?




More information about the Python-list mailing list