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
I get a false-positive no-untyped-def on the non-@overload-decorated definition.
To Reproduce
Example from PEP 484:
In regular modules, a series of @overload-decorated definitions must be followed by exactly one non-@overload-decorated definition (for the same function/method).
We need annotations on the overload implementation so that we can type check its body.
Hm - I wonder why mypy does not simply check the body once for each overload.
Anyway, assuming we can ignore PEP 484, I wonder how to implement this correctly. I mean, the point of the overloads is to separate disjoint sets of argument types, so it seems somewhat pointless to combine them again into a single type annotation that covers all overloads. Here's an example that does not work, but maybe I am approaching it the wrong way:
Bug Report
I get a false-positive
no-untyped-def
on the non-@overload
-decorated definition.To Reproduce
Example from PEP 484:
Expected Behavior
No error.
Actual Behavior
Your Environment
--disallow-untyped-defs
(!)mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: