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, daughters=daughters)
>>
>
> Most probably, here is the
bieff...@gmail.com wrote:
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, daughters=daughters)
Most probably, here is the problem : try this
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, daughters=daughters)
>
Most probably, here is the problem : try this instead:
def new_no
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, daughters=daughters)
n0 = new_node(id='n0')
n1 = new_node(id='n1')
[snip]
See
http://www.python.org/doc/faq/gene
On Sat, Mar 14, 2009 at 12:31 PM, 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, daughters=daughters)
This is something of a FAQ:
http://effbot.org/zone/de
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'