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/general/#why-are-default-values-shared-between-objects
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to