Skip to content
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

Mypy complains about issues after cache is filled #11046

Open
kasium opened this issue Sep 2, 2021 · 1 comment
Open

Mypy complains about issues after cache is filled #11046

kasium opened this issue Sep 2, 2021 · 1 comment
Labels

Comments

@kasium
Copy link

kasium commented Sep 2, 2021

Bug Report

I have a simpel dot dict implementation. But if I change something in my code somewhere else, mypy complains with weird errors. My current workaround is, to delete the mypy cache before each run

To Reproduce

(Write your steps here:)

  1. Clean the mypy cache
  2. Create x.py
class DotDict(dict):
    __setattr__ = dict.__setitem__
    __delattr__ = dict.__delitem__
    __getattr__ = dict.get
  1. mypy x.py --> works fine
  2. Add a=2 to the end of x.py
  3. mypy x.py --> error
x.py:2: error: Incompatible types in assignment (expression has type "Callable[[Dict[_KT, _VT], _KT, _VT], None]", base class "object" defined the type as "Callable[[object, str, Any], None]")
x.py:3: error: Incompatible types in assignment (expression has type "Callable[[Dict[_KT, _VT], _KT], None]", base class "object" defined the type as "Callable[[object, str], None]")

Expected Behavior

No error

Actual Behavior

Error; seems like a caching issue

Your Environment

  • Mypy version used: 0.910
  • Mypy command-line flags: nothing
  • Mypy configuration options from mypy.ini (and other config files): nothing
  • Python version used: 3.7.1
  • Operating system and version: Linux
@kasium kasium added the bug mypy got something wrong label Sep 2, 2021
@hauntsaninja
Copy link
Collaborator

Thanks for the report! I can repro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants