Using types-lxml types in external code #18
Replies: 3 comments
-
First things first, actually it is expected to only import classes from source, not from external stubs directly. And there are a few ways to migitate the problem:
(2) automatically helps achieving (1) for you without your intervention, but you would need to remember adding
Yes, the documentation absolutely needs some love. I think I can get something done after clearing my current tasks at hand. I'll leave the report open for now as reminder. |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for your response, that has solved things for me. |
Beta Was this translation helpful? Give feedback.
-
Doc now available on wiki. |
Beta Was this translation helpful? Give feedback.
-
This library does a great job of typing the results from
lxml
functions. I can see, for example, that the XMLparse
method returns a type_ElementTree[_Element]
. However, I cannot see a way to use these types in my own code. For example, I'd like to write a method which takes an ElementTree as an argument:but I can't work out how to import these types. I tried:
but this didn't work. So:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions