Issue 14814: Add namespaces keyword arg to find(*) methods in _elementtree.

Add attrib keyword to Element and SubElement in _elementtree.
Patch developed with Ezio Melotti.
This commit is contained in:
Eli Bendersky 2012-05-29 06:02:56 +03:00
parent 6bed342b58
commit 737b173355
4 changed files with 169 additions and 34 deletions

View file

@ -205,6 +205,9 @@ class Element:
# constructor
def __init__(self, tag, attrib={}, **extra):
if not isinstance(attrib, dict):
raise TypeError("attrib must be dict, not %s" % (
attrib.__class__.__name__,))
attrib = attrib.copy()
attrib.update(extra)
self.tag = tag