I'm using VSCode with pylance enabled.
Having a node: lxml.etree._Element, I'm trying to use the method node.iterchildren("InlineTable", "Table", "TableUsage"), but the type checker complains about the "Table" argument:
Argument of type "Literal['Table']" cannot be assigned to parameter "reversed" of type "bool" in function "iterchildren"
"Literal['Table']" is incompatible with "bool"
Seems like many of the methods in etree.pyi are defined with the *tags argument at the end, like this:
I'm using VSCode with pylance enabled. Having a
node: lxml.etree._Element
, I'm trying to use the methodnode.iterchildren("InlineTable", "Table", "TableUsage")
, but the type checker complains about the"Table"
argument:Seems like many of the methods in
etree.pyi
are defined with the*tags
argument at the end, like this:while the code definition in the lxml repository is:
This means the
reversed
argument is actually a keyword argument, and calls would result in: