lxml/lxml — Issue #29: elt.attrib doesn't work like a dictionary when .update is called
Author: bdhumb
Created: 2012-01-23 04:02:20+00:00
State: open

The following code which should work perfectly to combine attributes:

import lxml.etree as ET
main = ET.Element("main")
another = ET.Element("another", foo="bar")
main.attrib.update(another.attrib)

does not work, but the explicit:

main.attrib.update({'foo': 'bar'})

does work. So I think there's an issue with the way that .attrib is implementing its "dictionary-like" behaviour.