
June 18, 2012
3:54 a.m.
Simon Sapin, 17.06.2012 19:46:
Le 17/06/2012 19:31, Stefan Behnel a écrit :
>>> qn = etree.QName(etree.Element("{ns}lname")) >>> qn.localname u'lname' >>> qn.namespace u'ns'
Exactly what I was looking for. Thanks!
The parameter is named text_or_uri_or_element in the source, but the docstring has text_or_uri and does not mention elements for the parameter value.
Hmm, right, thanks for catching that.
Internally it looks like it still goes through the .tag property: build a string with {} and then split it. Oh well, at least it should be correct.
Yes, there's some overhead involved. That's easy enough to change if it proves necessary, but I'm yet to see a performance critical use case. Stefan