Appending a list's elements to another list using a list comprehension
hniksic at xemacs.org
Thu Oct 18 15:07:22 CEST 2007
Paul Hankin <paul.hankin at gmail.com> writes:
> Not to me: I can never remember which of a.append and a.extend is
Interesting, with me it's the other way around. Maybe it's because I
used Python before extend was available.
> Falling back to a = a + b is exactly what you want.
Not if you want to mutate the original object, possibly referenced
More information about the Python-list