We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
consider a utility function:
from __future__ import annotations from uuid import UUID def utility_function(data: list[str | UUID] | None): pass
If I'm using it in this context, mypy complains:
def other_function(data: list[str]): utility_function(data)
raises:
error: Argument "data" to "utility_function" has incompatible type "list[str]"; expected "list[UUID | str] | None" [arg-type] `
error: Argument "data" to "utility_function" has incompatible type "list[str]"; expected "list[UUID | str] | None" [arg-type]
This kind of data dependency should be accepted no?
mypy version: 1.13.0
The text was updated successfully, but these errors were encountered:
https://mypy.readthedocs.io/en/stable/common_issues.html#invariance-vs-covariance
Sorry, something went wrong.
No branches or pull requests
consider a utility function:
If I'm using it in this context, mypy complains:
raises:
error: Argument "data" to "utility_function" has incompatible type "list[str]"; expected "list[UUID | str] | None" [arg-type]
`
This kind of data dependency should be accepted no?
mypy version: 1.13.0
The text was updated successfully, but these errors were encountered: