There a many ways to do this, here's one:

from collections import namedtuple
Tree = namedtuple('Tree', ['feature', 'children'])
t = Tree(1, [Tree('hello', []), Tree(3, [])])
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to