-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
"object" not callable (another thorny partial
issue)
#2779
Comments
The latest mypy version complains about the example (the type annotation for
If the annotation is left out, I can reproduce the issue -- the inferred type of The recommended workaround is to use The fix to #797 may also fix this issue. |
Maybe mypy should special-case functools.partial?
|
Always process modules/packages given with -m/-p. Fixes #2779.
Whoops. Thanks for noticing! |
@gvanrossum I believe mypy indeed should special-case functools.partial, in a way that will make binding of self (including the treatment of selftype) "fall out" of the implementation. |
I suspect that this will be closed in favor of #1484, but it seemed that creating a separate issue would be more convenient for tidiness.
I have some code which is yielding a mypy error:
The code looks similar to this (with the line of the error denoted by
<---
):It was only after fully writing out an Issue for this that I realized that the core issue was related to lack of
partial
support, rather than an issue with myCallable
declaration, or a different bug inmypy
.Obviously this will become a moot point when
partial
is properly supported, but in the meantime, I would have expected themypy
error to occur on thepartial(...)
line within the list, rather than within thefor
loop.The text was updated successfully, but these errors were encountered: