Skip to content

Type ignore comments erroneously marked as unused by dmypy #15043

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

Merged
merged 14 commits into from
Jun 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into unexpected-unused-type-ignore
  • Loading branch information
ilevkivskyi authored Jun 20, 2025
commit 6c378b12e4991c4407fd0cb8c08bd6809dfb74c7
2 changes: 0 additions & 2 deletions mypy/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ def generate_unused_ignore_errors(self, file: str) -> None:
code=codes.UNUSED_IGNORE,
blocker=False,
only_once=False,
allow_dups=False,
origin=(self.file, [line]),
target=self.target_module,
)
Expand Down Expand Up @@ -840,7 +839,6 @@ def generate_ignore_without_code_errors(
code=codes.IGNORE_WITHOUT_CODE,
blocker=False,
only_once=False,
allow_dups=False,
origin=(self.file, [line]),
target=self.target_module,
)
Expand Down
18 changes: 18 additions & 0 deletions test-data/unit/daemon.test
Original file line number Diff line number Diff line change
Expand Up @@ -784,3 +784,21 @@ import a_module_which_does_not_exist
class A:
def __init__(self) -> None:
self.__attrs_init__() # type: ignore[attr-defined]

[case testDaemonImportAncestors]
$ dmypy run test.py
Daemon started
test.py:2: error: Unsupported operand types for + ("int" and "str") [operator]
Found 1 error in 1 file (checked 1 source file)
== Return code: 1
$ dmypy run test.py
test.py:2: error: Unsupported operand types for + ("int" and "str") [operator]
Found 1 error in 1 file (checked 1 source file)
== Return code: 1
$ dmypy run test.py
test.py:2: error: Unsupported operand types for + ("int" and "str") [operator]
Found 1 error in 1 file (checked 1 source file)
== Return code: 1
[file test.py]
from xml.etree.ElementTree import Element
1 + 'a'
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy