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

Fix line number for slices, clean up old logic #18397

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hauntsaninja
Copy link
Collaborator

Fixes #17655

The decorator cleanup moves a type ignore, but so does the bug fix for decorators in #18392 , so might as well batch into a single release

Fixes python#17655

The decorator cleanup moves a type ignore, but so does the bug fix
in python#18392 , so might as well batch into a single release

This comment has been minimized.

@hauntsaninja
Copy link
Collaborator Author

hauntsaninja commented Dec 31, 2024

werkzeug seems good (hiding false negatives)
schemathesis seems good (hiding false negatives)
antidote is fine (also repo is archived)
homeassistant is confusing
trio is unfortunate. we should add a better error code for explicit any (which would require a change for them as well) (edit: #18398 )
pandas is unfortunate

Overall, I think we should merge. I can add a changelog entry though

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Jan 1, 2025

Diff from mypy_primer, showing the effect of this PR on open source code:

pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/period.py:378: error: Unused "type: ignore" comment  [unused-ignore]
+ pandas/core/arrays/period.py:379: error: Cannot override writeable attribute with read-only property  [override]

trio (https://github.com/python-trio/trio)
+ src/trio/_path.py:196: error: Unused "type: ignore" comment  [unused-ignore]
+ src/trio/_path.py:197: error: Explicit "Any" is not allowed  [misc]
+ src/trio/_path.py:197: error: Type of decorated function contains type "Any" ("Callable[[Path, VarArg(Any), KwArg(Any)], Awaitable[AsyncIOWrapper[IO[Any]]]]")  [misc]
+ src/trio/_tests/test_subprocess.py:85: error: Unused "type: ignore" comment  [unused-ignore]
+ src/trio/_tests/test_subprocess.py:86: error: Explicit "Any" is not allowed  [misc]
+ src/trio/_tests/test_subprocess.py:86: error: Type of decorated function contains type "Any" ("Callable[[VarArg(Any), KwArg(Any)], _AsyncGeneratorContextManager[Process]]")  [misc]
+ src/trio/_tests/test_subprocess.py:98: error: Unused "type: ignore" comment  [unused-ignore]
+ src/trio/_tests/test_subprocess.py:99: error: Explicit "Any" is not allowed  [misc]
+ src/trio/_tests/test_subprocess.py:99: error: Type of decorated function contains type "Any" ("Callable[[VarArg(Any), KwArg(Any)], _AsyncGeneratorContextManager[Process]]")  [misc]
+ src/trio/_core/_tests/test_ki.py:168: error: Function is untyped after decorator transformation  [misc]
+ src/trio/_core/_tests/test_ki.py:177: error: Function is untyped after decorator transformation  [misc]
+ src/trio/_core/_tests/test_ki.py:187: error: Function is untyped after decorator transformation  [misc]
+ src/trio/_core/_tests/test_ki.py:196: error: Function is untyped after decorator transformation  [misc]

core (https://github.com/home-assistant/core)
+ homeassistant/components/zha/device_tracker.py:64: error: Unused "type: ignore[explicit-override]" comment  [unused-ignore]

schemathesis (https://github.com/schemathesis/schemathesis)
+ src/schemathesis/cli/__init__.py:834: error: Unused "type: ignore" comment  [unused-ignore]
+ src/schemathesis/cli/__init__.py:864: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]

antidote (https://github.com/Finistere/antidote)
+ tests/lib/lazy/test_lazy.py:293: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:301: error: Missing return statement  [empty-body]
+ tests/lib/lazy/test_lazy.py:308: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_lazy.py:441: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_lazy.py:447: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_function.py:306: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_function.py:312: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_function.py:318: error: Missing return statement  [empty-body]
+ tests/lib/interface/test_function.py:324: error: Missing return statement  [empty-body]

werkzeug (https://github.com/pallets/werkzeug)
+ tests/test_exceptions.py:147: error: Function is missing a return type annotation  [no-untyped-def]
+ tests/test_exceptions.py:147: note: Use "-> None" if function does not return a value
+ tests/test_exceptions.py:167: error: Function is missing a return type annotation  [no-untyped-def]
+ tests/test_exceptions.py:167: note: Use "-> None" if function does not return a value

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

Successfully merging this pull request may close these issues.

Ignore doesn't work when two errors share a line
1 participant