
Thanks to both Charlie and Jens. This is a really terrific list: lots of prompt, terse, and good advice, and the noise level is remarkably low. A good example for the world at large Martin Mueller Professor emeritus of English and Classics Northwestern University On 1/27/15 10:51 AM, "Charlie Clark" <charlie.clark@clark-consulting.eu> wrote:
Am .01.2015, 17:38 Uhr, schrieb jens quade <jq@qdevelop.de>:
you still copy the attribute values, but all at once:
y.attrib.update(x.items()) x.attrib.clear()
Nice trick!
y.attrib.update(x.attrib) is also possible. I don't know if there's any performance improvement on not calling the items method.
Charlie -- Charlie Clark Managing Director Clark Consulting & Research German Office Kronenstr. 27a Düsseldorf D- 40217 Tel: +49-211-600-3657 Mobile: +49-178-782-6226 _________________________________________________________________ Mailing list for the lxml Python XML toolkit - http://lxml.de/ lxml@lxml.de https://mailman-mail5.webfaction.com/listinfo/lxml