Re: Can't create list of dictionaries

2009-04-11 Thread Gabriel Genellina
On Apr 10, 12:36 pm, sophie_newbie 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 af

Re: Can't create list of dictionaries

2009-04-10 Thread Piet van Oostrum
> sophie_newbie (sn) wrote: >sn> Hi there, >sn> I've got a function that returns a dictionary, I need to loop and >sn> return 1000 dictionaries and append them to a list, but the thing is >sn> that when I do the list.append(funtThatReturnsDict()) the resulting >sn> only ever has 1 dictionary

Re: Can't create list of dictionaries

2009-04-10 Thread Peter Otten
sophie_newbie wrote: > Hi there, > > 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 aft

Re: Can't create list of dictionaries

2009-04-10 Thread John Machin
On Apr 10, 9:49 pm, sophie_newbie wrote: > Scratch everything I said, copy() does work. Made a wee mistake > somewhere else. > > Apologies if I've wasted anyones time! U ... if think you need a dict.copy() *after* the function has returned, then you are likely to be doing it in a way that per

Re: Can't create list of dictionaries

2009-04-10 Thread John Machin
On Apr 10, 9:36 pm, sophie_newbie wrote: > Hi there, > > 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 attac

Re: Can't create list of dictionaries

2009-04-10 Thread sophie_newbie
Scratch everything I said, copy() does work. Made a wee mistake somewhere else. Apologies if I've wasted anyones time! On Apr 10, 12:36 pm, sophie_newbie wrote: > Hi there, > > I've got a function that returns a dictionary, I need to loop and > return 1000 dictionaries and append them to a list