lxml / lxml-stubs

Type stubs for the lxml package
Other
43 stars 28 forks source link

"ObjectifiedElement" has not attribute XXX #61

Closed hongyuan1306 closed 2 years ago

hongyuan1306 commented 2 years ago

Hi,

I am using objectify.fromstring to turn xml into python object, like this:

message = objectify.fromstring(xml)
print(message.MsgType)

However, runing mypy on the code will give something like:

message.py:104: error: "ObjectifiedElement" has no attribute "MsgType"

I think the type hinting of ObjectifiedElement shall allow arbitrary attribute, but it does not seem to work as I expected. How to make the error go away?