-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
base: master
Are you sure you want to change the base?
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.
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.
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
|
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