Is it possible to subclass cElementTree.El ement? I tried[color=blue][color=green][color=darkred]
>>> import cElementTree as et
>>> class Elt(et.Element) :[/color][/color][/color]
... pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: Error when calling the metaclass bases
cannot create 'builtin_functi on_or_method' instances
I want to create a tree where I can navigate from a node to its parent. The standard Element class
doesn't seem to support this so I am trying to make a subclass that does. The XML files in question
are large so the speed of cElementTree is very helpful.
Thanks,
Kent
(apologies if this is a duplicate post)
>>> import cElementTree as et
>>> class Elt(et.Element) :[/color][/color][/color]
... pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: Error when calling the metaclass bases
cannot create 'builtin_functi on_or_method' instances
I want to create a tree where I can navigate from a node to its parent. The standard Element class
doesn't seem to support this so I am trying to make a subclass that does. The XML files in question
are large so the speed of cElementTree is very helpful.
Thanks,
Kent
(apologies if this is a duplicate post)
Comment