Eli Bendersky added the comment:
TreeBuilder is an interface users can implement. As such, 'tag' is a
convenience the user-defined tree builder can use, as in:
class Target(object):
def start(self, tag, attrib):
print('i see start', tag)
def end(self, tag):
print('i see end', tag)
def close(self):
return "DONE"
parser = ET.XMLParser(target=Target())
parser.feed("<TAG>sd</TAG>")
The default TreeBuilder simply needs to build the tree, and it doesn't actually
use the tag argument (except for some sanity checking in the Python version).
But user code is free to use it.
----------
resolution: -> wont fix
stage: test needed -> committed/rejected
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue7214>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com