On Apr 10, 12:36 pm, sophie_newbie <paulgeele...@gmail.com> wrote:
I've got a function that returns a dictionary, I need to loop and
return 1000 dictionaries and append them to a list, but the thing is
that when I do the list.append(funtThatReturnsDict()) the resulting
only ever has 1 dictionary attached to it, even after running the
append function 1000 times!
I've tried using dict.copy() on the dictionary that was returned from
the function but this didn't work either.
En Fri, 10 Apr 2009 08:49:12 -0300, sophie_newbie <paulgeele...@gmail.com>
escribió:
Scratch everything I said, copy() does work. Made a wee mistake
somewhere else.
If the function is supposed to return a *different* dictionary each time,
ensure that, don't "fix" the result value after it has returned.
--
Gabriel Genellina
--
http://mail.python.org/mailman/listinfo/python-list