-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Callable[[Any], None]" has no attribute "__defaults__" #11896
New issue
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
Comments
It looks to me like the issue is that the definition for the (fictional) You can get similar mypy errors for the following attributes, which are also defined on
|
@AlexWaygood Is there any reason we can't just have If not then I'm happy to just copy the attributes over from |
There have been previous attempts to delete |
Closing as we've fixed this in typeshed 👍 |
Bug Report
mypy produces the false positive
Callable[[Any], None]" has no attribute "__defaults__"
when code uses the__defaults__
attribute of a function.To Reproduce
Consider this code:
Run mypy on a script containing this code and get the false-positive:
Expected Behavior
No mypy errors since it's a valid attribute of a function.
Actual Behavior
mypy errors shown above.
Your Environment
mypy.ini
(and other config files): N/AThe text was updated successfully, but these errors were encountered: