-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
patch.dict(x, y) interpreted as invoking __call__, not __init__ #5118
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
I think this is a bug in the stubs. |
Can one of you submit a PR to typeshed? |
Let me give it a spin |
Should we also wrap dict in ClassVar ? |
I think you can just do |
@JelleZijlstra you can in Python 3; for some reason that fails on Python 2 (see the typeshed CI job). |
Uh oh!
There was an error while loading. Please reload this page.
Note: if you are reporting a wrong signature of a function or a class in
the standard library, then the typeshed tracker is better suited
for this report: https://github.com/python/typeshed/issues
I think this is a mypy bug, happy to be sent to typeshed though.
I'm using mypy 0.6, and have the following code:
This errors like so:
error: Too many arguments for "__call__" of "_patch_dict"
The typeshed stub for this is
So mypy should be able to tell that this is instantiating an instance of _patch_dict with
__init__
and then that instance is being called with one argument - the curried patcher next inwards in the stack.The text was updated successfully, but these errors were encountered: