comparison emeraldtree/ElementTree.py @ 46:c228aba7258c

ElementTree - Also check nodes in children attribute
author Bastian Blank <bblank@thinkmo.de>
date Sun, 27 Jul 2008 20:57:32 +0200
parents 722101222098
children e647f30cc08e
comparison
equal deleted inserted replaced
45:722101222098 46:c228aba7258c
187 def __init__(self, tag, attrib=None, children=(), **extra): 187 def __init__(self, tag, attrib=None, children=(), **extra):
188 attrib = attrib and attrib.copy() or {} 188 attrib = attrib and attrib.copy() or {}
189 attrib.update(extra) 189 attrib.update(extra)
190 self.tag = tag 190 self.tag = tag
191 self.attrib = attrib 191 self.attrib = attrib
192 self._children = list(children) 192 self._children = [self._check_node(i) for i in children]
193 193
194 def __repr__(self): 194 def __repr__(self):
195 return "<Element %s at %x>" % (repr(self.tag), id(self)) 195 return "<Element %s at %x>" % (repr(self.tag), id(self))
196 196
197 ## 197 ##