[Twisted-Python] domish.Element.__getattr__() or xpath.XPathQuery

Gabriel Rossetti gabriel.rossetti at arimaz.com
Thu Feb 4 05:48:28 EST 2010

Hello everyone,

I was wondering what you would recommend, accessing nodes via 
(e.g. el.node1.node1_1, where el is /msg) or via xpath.XPathQuery()
(e.g. xpath.XPathQuery("/msg/node1/node1_1").queryForNodes(el)[0])?

I was wondering which would be faster, the __getattr__() is O(n) (in my 
example there are 2 calls) but what about xpath.XPathQuery()?

Thank you,

More information about the Twisted-Python mailing list