-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Cannot assign to field of Callable type #708
Copy link
Copy link
Labels
affects-typeshedAnything that blocks a typeshed changeAnything that blocks a typeshed changebugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-0-highsize-largetopic-descriptorsProperties, class vs. instance attributesProperties, class vs. instance attributes
Metadata
Metadata
Assignees
Labels
affects-typeshedAnything that blocks a typeshed changeAnything that blocks a typeshed changebugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codepriority-0-highsize-largetopic-descriptorsProperties, class vs. instance attributesProperties, class vs. instance attributes
Consider this example:
mypy reports:
while I'd expect this to work.
Note that there is a second error in the reporting of the type of the variable.
Also, this passes type checking (correctly):