Re: [Tutor] Instance into another instance

2005-02-20 Thread Kent Johnson
Ismael Garrido wrote: Kent Johnson wrote: Are you creating a tree to represent XML data? There are many packages available that do this. You might want to look at ElementTree which is one of the easiest to use. In fact, even if you aren't trying to represent XML you might find ElementTree useful

Re: [Tutor] Instance into another instance

2005-02-20 Thread Kent Johnson
Ismael Garrido wrote: The idea of the class is to be able to create a "tree". Where each node can have subnodes, which in turn can have their subnodes... Are you creating a tree to represent XML data? There are many packages available that do this. You might want to look at ElementTree which is o

Re: [Tutor] Instance into another instance

2005-02-19 Thread Gregor Lingl
Ismael Garrido schrieb: Hello. This is my code: class Node: def __init__(self, tag, value=None, **kwargs): self.tag = tag self.value = value self.kwargs = kwargs self.childs = [] def addChild(self, tag, value=None, **kwargs): node = Node(tag, value, kwargs)

[Tutor] Instance into another instance

2005-02-19 Thread Ismael Garrido
Hello. This is my code: class Node: def __init__(self, tag, value=None, **kwargs): self.tag = tag self.value = value self.kwargs = kwargs self.childs = [] def addChild(self, tag, value=None, **kwargs): node = Node(tag, value, kwargs) self.childs.appen