I found an earlier post about subclassing cElementTree.El ement which
can't
be done because it is a factory method. I am trying to subclass
XMLTreeBuilder
with success using the python implementation, but not with
cElementTree.
[1013]$ python
Python 2.3.4 (#1, Feb 22 2005, 04:09:37)
[GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.
.... pass
....
.... pass
....
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: cannot create 'builtin_functi on_or_method' instances
Is it possible to subclass cElementTree.XM LTreeBuilder?
Thanks,
Mike
can't
be done because it is a factory method. I am trying to subclass
XMLTreeBuilder
with success using the python implementation, but not with
cElementTree.
[1013]$ python
Python 2.3.4 (#1, Feb 22 2005, 04:09:37)
[GCC 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.
>>import elementtree.Ele mentTree
>>class X(elementtree.E lementTree.XMLT reeBuilder):
>>class X(elementtree.E lementTree.XMLT reeBuilder):
....
>>import cElementTree
>>class Y(cElementTree. XMLTreeBuilder) :
>>class Y(cElementTree. XMLTreeBuilder) :
....
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: cannot create 'builtin_functi on_or_method' instances
>>>
Thanks,
Mike
Comment