Open KotlinIsland opened 1 year ago
I cannot reproduce this error with default settings, but I think that you mean --disallow-any-expr
:
ยป mypy ex.py --disallow-any-expr
ex.py:4: error: Expression type contains "Any" (has type "tuple[str, Any]") [misc]
ex.py:4: error: Expression has type "Any"
So, the problem is that the error message is shown twice, isn't it?
So, the problem is that the error message is shown twice, isn't it?
Well, I can see two expressions that contain Any
, any
and {"a": any}
, but neither of these expressions are a tuple
.
When checking {"a": any}
mypy represents it as a tuple
of key and value, which is kinda what it is.
When checking
{"a": any}
mypy represents it as atuple
of key and value, which is kinda what it is.
Yeah, that does make sense that mypy would, as an implementation detail, model this as a tuple
. But in reality it's not, so the error message here doesn't make Any
sense.
tuple[str, Any]