append on lists

John Machin sjmachin at lexicon.net
Mon Sep 15 16:47:24 EDT 2008


On Sep 16, 6:45 am, Armin <a... at nospam.org> wrote:

> Yes, but this is very unconvenient.
> If d should reference the list a extended with a single list element
> you need at least two lines
>
> a.append(7)
> d=a
>
> and not more intuitive d = a.append(7)

Methods/functions which return a value other than the formal None and
also mutate their environment are "a snare and a delusion". Don't wish
for them.

Inconvenient? How often do you want to mutate a list and then set up
another reference to it?




More information about the Python-list mailing list