-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Argument "nsmap" to "Element" has incompatible type #31
Comments
Hmm, the error looks wrong to me. I would expect |
This is a variance issue; Dict is invariant in its key type. See https://mypy.readthedocs.io/en/stable/common_issues.html#invariance-vs-covariance. |
Mostly a duplicate of the more general #29 |
Just noticed this part: In this code path which seems to be used by If it is decided lxml shouldn't support it in annotation, this issue can be treated as the same as #29, otherwise namespace mappings would need extra consideration of its own. |
The type hints are incomplete anyway. Anything that helps users will probably be fine. Let's mark this as duplicate of #29 and wait for someone to actually complain. |
This simplified code reproduces an error I am seeing when running mypy over my project.
The following error is produced.
I am using:
I did some searching and found TypeVar and TypedDict but neither of those seemed to be able to address the issue. Does anyone have suggestions on how to resolve this typing error?
Please let me know if you need more info and thanks in advance.
The text was updated successfully, but these errors were encountered: