don't understand behaviour of recursive structure

2009-03-14 Thread Dan Davison
I'm new to python. Could someone please explain the following behaviour of a recursive data structure? def new_node(id='', daughters=[]): return dict(id=id, daughters=daughters) n0 = new_node(id='n0') n1 = new_node(id='n1') ## Seems OK so far: n0 # {'id': 'n0'

Re: don't understand behaviour of recursive structure

2009-03-14 Thread Dan Davison
bieff...@gmail.com writes: > On 14 Mar, 17:31, Dan Davison wrote: >> I'm new to python. Could someone please explain the following behaviour >> of a recursive data structure? >> >> def new_node(id='', daughters=[]): >>     return dict(id=id, daught