You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the only thing I can find in the docs about this HTML report, and it's far from complete. I could find thesethreequestions on Stack Overflow, but none of them have satisfying answers (or answers at all).
I understand that mypy is reporting the presence of expressions of type Any in each line. (Is it? Did I get that right?) But what exactly do the colors mean? Why do lines with @overload always get colored red in my reports? Why do lines with isinstance always get colored yellow?
Reacted by Shay Nehmad, Kurt McKee, wwwhhhiii and Matheus Santos
I was able to replicate your problems on mypy master (mypy 2.0.0+dev.3cda6ec255a530e7da8bec44d197399aec73e96d (compiled: no)), such as the @overload thing. I think this is a bug, especially considering that the typeshed definition of overload does not contain Any, but it is hard for me to say definitively (due to the lack of documentation).
The @overload lines are red but on hover say "No Anys on this line!". Surprisingly, this is also true of def foo(x): and def foo5(x):
My isinstance lines are always colored green, not yellow. In fact, the line isinstance(1,list) is green, but on hover it says Any Types on this line: Omitted Generics (x3). I think this kind of makes sense as behavior given the rules about isinstance but I think in that case the hovertext should maybe be different.
In the following code, the print("OK") line is colored red despite on hover saying No Anys on this line!. The if isinstance(v,list): line is green despite saying Any Types on this line: Omitted Generics (x3)
Activity
wyattscarpenter commentedon Apr 4, 2026
Duplicate of #912, I think. But anyone who fixes that should keep in mind to document it in a way that answers your questions!
wyattscarpenter commentedon Apr 4, 2026
I was able to replicate your problems on mypy master (
mypy 2.0.0+dev.3cda6ec255a530e7da8bec44d197399aec73e96d (compiled: no)), such as the@overloadthing. I think this is a bug, especially considering that the typeshed definition of overload does not containAny, but it is hard for me to say definitively (due to the lack of documentation).With the following code:
And the following command:
I get the following result:
The
@overloadlines are red but on hover say "No Anys on this line!". Surprisingly, this is also true ofdef foo(x):anddef foo5(x):My
isinstancelines are always colored green, not yellow. In fact, the lineisinstance(1,list)is green, but on hover it saysAny Types on this line: Omitted Generics (x3). I think this kind of makes sense as behavior given the rules aboutisinstancebut I think in that case the hovertext should maybe be different.In the following code, the
print("OK")line is colored red despite on hover sayingNo Anys on this line!. Theif isinstance(v,list):line is green despite sayingAny Types on this line: Omitted Generics (x3)Possibly related: #14297