[issue14818] C implementation of ElementTree: Some functions should support keyword arguments
Ezio Melotti
report at bugs.python.org
Fri May 18 12:59:52 CEST 2012
Ezio Melotti <ezio.melotti at gmail.com> added the comment:
Attached patch fixes Element constructor to accept 'attrib' as keyword arg. I couldn't find a way to make this work using PyArg_ParseTupleAndKeywords, so I ended up parsing the kwds by hand.
While adding more tests I found out another difference with the Python version. The C version raises a TypeError if attrib is not a dict, whereas the Python version raises an AttributeError while attempting to do a .copy() of the object. I changed the Python version to raise a TypeError too.
----------
Added file: http://bugs.python.org/file25628/issue14818-2.diff
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14818>
_______________________________________
More information about the Python-bugs-list
mailing list