[docs] Omission of namespace parameter to etree.findall(..) etc.

Sergeev Evgeni evgeni at hotmail.ru
Tue Mar 10 09:39:31 CET 2015

On this page: https://docs.python.org/2/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.findall

See the discussion here: http://stackoverflow.com/a/14853417/1143274

These extra arguments should really be documented, as they are quite important for painless parsing where namespaces are involved. 


P.S. I met this issue because I couldn't find the  tag within . It turned out that I have to delve into XML namespaces, and the most straightforward approach to write readable code turned out to be via the undocumented etree_instance.findall('svg:g', nss) calls, where nss is a dictionary of namespaces like {'svg': 'http://www.w3.org/2000/svg'}. By the way, it would be nice for it to support something like {'': 'http://www.w3.org/2000/svg'} to indicate the default namespace...

P.S.S. I was about to submit a report to the bugtracker, but it turned out that my email address would have been visible to all logged-in users. Obviously, this is accessible to robots who can get a Google OpenID and log in automatically. Therefore, I'm sending this report from my spamfest email account. The point is: this arrangement scares off spam-averse users like me from submitting bug reports.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20150310/e36c38e1/attachment.html>

More information about the docs mailing list