mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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:
parent
6bed342b58
commit
737b173355
4 changed files with 169 additions and 34 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue