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

Cache re-used incorrectly #16652

Open
bersbersbers opened this issue Dec 12, 2023 · 0 comments
Open

Cache re-used incorrectly #16652

bersbersbers opened this issue Dec 12, 2023 · 0 comments
Labels
bug mypy got something wrong topic-incremental

Comments

@bersbersbers
Copy link

Bug Report

Same command gives different results depending on the cache.

To Reproduce

class Super:
    def draw(self):
        ...

class Class(Super):
    ...

Class().draw()

(Code is from #16651)

Expected Behavior

Same behavior of mypy --disallow-untyped-calls --untyped-calls-exclude=bug.Super bug.py regardless of the cache.

Actual Behavior

(.venv) C:\Build>rmdir .mypy_cache /s /q 

(.venv) C:\Build>mypy --disallow-untyped-calls --untyped-calls-exclude=bug.Super bug.py                   
bug.py:8: error: Call to untyped function "draw" in typed context  [no-untyped-call]
Found 1 error in 1 file (checked 1 source file)

(.venv) C:\Build>mypy --disallow-untyped-calls --untyped-calls-exclude=bug bug.py        
Success: no issues found in 1 source file

(.venv) C:\Build>mypy --disallow-untyped-calls --untyped-calls-exclude=bug.Super bug.py 
Success: no issues found in 1 source file

(.venv) C:\Build>rmdir .mypy_cache /s /q   

(.venv) C:\Build>mypy --disallow-untyped-calls --untyped-calls-exclude=bug.Super bug.py  
bug.py:8: error: Call to untyped function "draw" in typed context  [no-untyped-call]
Found 1 error in 1 file (checked 1 source file)

Your Environment

  • Mypy version used: 1.7.1.
  • Mypy command-line flags: see above
  • Mypy configuration options from mypy.ini (and other config files): none
  • Python version used: 3.12.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-incremental
Projects
None yet
Development

No branches or pull requests

2 participants