10000 `var-annotated` behaves differently with daemon · Issue #10847 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

var-annotated behaves differently with daemon #10847

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

Closed
DetachHead opened this issue Jul 21, 2021 · 6 comments
Closed

var-annotated behaves differently with daemon #10847

DetachHead opened this issue Jul 21, 2021 · 6 comments
Labels
bug mypy got something wrong topic-daemon dmypy

Comments

@DetachHead
Copy link
Contributor

Bug Report

class Foo:
    bar = None

when running with dmypy:

$ dmypy run -- foo.py
Restarting: configuration changed
Daemon stopped
Daemon started
foo.py: note: In class "Foo":
foo.py:2: error: Need type annotation for "bar"  [var-annotated]
        bar = None
        ^
Found 1 error in 1 file (checked 1 source file)

when running with mypy:

$ mypy foo.py
Success: no issues found in 1 source file

Your Environment

  • Mypy version used: 0.910
  • Mypy command-line flags: none
  • Mypy configuration options from mypy.ini (and other config files):
    [mypy]
    exclude = venv
    mypy_path = stubs
    warn_redundant_casts = True
    show_error_context = True
    pretty = True
    follow_imports = skip
    allow_redefinition = True
    show_error_codes = True
  • Python version used: 3.9.6
  • Operating system and version: windows 10 1909
@DetachHead DetachHead added the bug mypy got something wrong label Jul 21, 2021
@KotlinIsland
Copy link
Contributor

Isn't this just because the daemon implicitly enables local_partial_types?
https://mypy.readthedocs.io/en/stable/config_file.html#confval-local_partial_types

@DetachHead
8000
Copy link
Contributor Author

seems silly that the daemon secretly changes random flags, i would expect it to behave the same way

@hauntsaninja
Copy link
Collaborator

Yeah, this is because of local partial types. I think Jukka is planning on making that the default, so closing as duplicae of #10169

@hauntsaninja hauntsaninja closed this as not planned Won't fix, can't repro, duplicate, stale Jun 22, 2024
@KotlinIsland
Copy link
Contributor

It's the default in basedmypy

@vergenzt
Copy link

Found this issue from googling, and sharing my further digging:

@KotlinIsland
Copy link
Contributor

in future, this error is going to be default for CLI invocations too

it's the default in basedmypy

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-daemon dmypy
Projects
None yet
Development

No branches or pull requests

5 participants
0