Fix line number for slices, clean up old logic#18397
Merged
hauntsaninja merged 4 commits intopython:masterfrom Jan 6, 2025
Merged
Fix line number for slices, clean up old logic#18397hauntsaninja merged 4 commits intopython:masterfrom
hauntsaninja merged 4 commits intopython:masterfrom
Conversation
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.
This comment has been minimized.
Collaborator
Author
|
werkzeug seems good (hiding false negatives) Overall, I think we should merge. I can add a changelog entry though |
This comment has been minimized.
This comment has been minimized.
Contributor
|
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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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