On Sat, Nov 25, 2017 at 11:55 PM, Stefan Behnel <stefan_ml@behnel.de> wrote:
Am 26. November 2017 08:08:49 MEZ schrieb Chris Jerdonek:
It doesn't seem to be documented that iterwalk() accepts more than one tag, but empirically I found that a tuple of tags can be passed as the tag argument to iterwalk(). Is that intentional?
Sort of. There used to be only the "tag" argument, which accepted one name. When adding support for multiple names, I didn't want to change the interfaces everywhere by renaming it to "tags", so I left it as it is and allowed tuples. iter() is special in that it accepts positional arguments, because it's such a widely used and exposed utility, and because it didn't conflict with its original interface.
Historical reasons, as always in these cases.
Documentation improvements welcome.
Thanks for the explanation. I posted a small improvement here: https://github.com/lxml/lxml/pull/257 --Chris
Stefan _________________________________________________________________ Mailing list for the lxml Python XML toolkit - http://lxml.de/ lxml@lxml.de https://mailman-mail5.webfaction.com/listinfo/lxml