-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Sync typeshed #17201
Merged
Merged
Sync typeshed #17201
Conversation
This file contains 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
Source commit: python/typeshed@f244be9
This is allegedly causing large performance problems, see 13821 typeshed/8231 had zero hits on mypy_primer, so it's not the worst thing to undo. Patching this in typeshed also feels weird, since there's a more general soundness issue. If a typevar has a bound or constraint, we might not want to solve it to a Literal. If we can confirm the performance regression or fix the unsoundness within mypy, I might pursue upstreaming this in typeshed. (Reminder: add this to the sync_typeshed script once merged)
… checking: #13987 (comment) A manual cherry-pick of e437cdf.
Diff from mypy_primer, showing the effect of this PR on open source code: jinja (https://github.com/pallets/jinja)
+ src/jinja2/async_utils.py:67: error: Redundant cast to "V" [redundant-cast]
antidote (https://github.com/Finistere/antidote)
+ src/antidote/lib/lazy_ext/_lazy.py:171: error: Non-overlapping identity check (left operand type: "Literal[FunctionKind.VALUE]", right operand type: "Literal[FunctionKind.METHOD]") [comparison-overlap]
+ src/antidote/lib/lazy_ext/_lazy.py:174: error: Unused "type: ignore" comment [unused-ignore]
+ src/antidote/lib/lazy_ext/_lazy.py:178: error: Non-overlapping identity check (left operand type: "Literal[FunctionKind.VALUE]", right operand type: "Literal[FunctionKind.PROPERTY]") [comparison-overlap]
+ src/antidote/lib/lazy_ext/_lazy.py:181: error: Unused "type: ignore" comment [unused-ignore]
+ src/antidote/lib/lazy_ext/_lazy.py:185: error: Non-overlapping identity check (left operand type: "Literal[FunctionKind.VALUE]", right operand type: "Literal[FunctionKind.FUNCTION]") [comparison-overlap]
+ tests/lib/interface/test_function.py:44: error: Unused "type: ignore" comment [unused-ignore]
+ tests/lib/interface/test_function.py:45: error: Unused "type: ignore" comment [unused-ignore]
+ tests/lib/interface/test_function.py:78: error: Unused "type: ignore" comment [unused-ignore]
+ tests/lib/interface/test_function.py:79: error: Unused "type: ignore" comment [unused-ignore]
+ tests/lib/interface/test_function.py:83: error: Unused "type: ignore" comment [unused-ignore]
+ tests/lib/interface/test_function.py:86: error: Unused "type: ignore" comment [unused-ignore]
+ tests/lib/interface/test_function.py:89: error: Unused "type: ignore" comment [unused-ignore]
+ tests/lib/interface/test_function.py:145: error: Unused "type: ignore" comment [unused-ignore]
+ tests/lib/interface/test_function.py:154: error: Unused "type: ignore" comment [unused-ignore]
+ tests/lib/interface/test_function.py:174: error: Unused "type: ignore" comment [unused-ignore]
+ tests/lib/interface/test_function.py:188: error: Unused "type: ignore" comment [unused-ignore]
+ tests/lib/interface/test_function.py:191: error: Unused "type: ignore" comment [unused-ignore]
+ tests/lib/interface/test_function.py:194: error: Unused "type: ignore" comment [unused-ignore]
pytest (https://github.com/pytest-dev/pytest)
+ testing/test_monkeypatch.py:418: error: Statement is unreachable [unreachable]
vision (https://github.com/pytorch/vision)
+ torchvision/models/_api.py:128: error: Unused "type: ignore" comment [unused-ignore]
spack (https://github.com/spack/spack)
- lib/spack/spack/oci/oci.py:142: error: Argument 1 to "endpoint" of "ImageReference" has incompatible type "str | None"; expected "str" [arg-type]
trio (https://github.com/python-trio/trio)
+ src/trio/_core/_ki.py:145: error: Item "None" of "Optional[FrameType]" has no attribute "f_locals" [union-attr]
+ src/trio/_core/_run.py:1784: error: Item "None" of "Optional[FrameType]" has no attribute "f_locals" [union-attr]
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ pymongo/__init__.py:176: error: Incompatible return value type (got "_TimeoutContext", expected "ContextManager[None]") [return-value]
+ pymongo/__init__.py:176: note: Following member(s) of "_TimeoutContext" have conflicts:
+ pymongo/__init__.py:176: note: Expected:
+ pymongo/__init__.py:176: note: def __enter__(self) -> None
+ pymongo/__init__.py:176: note: Got:
+ pymongo/__init__.py:176: note: def __enter__(self) -> _TimeoutContext
spark (https://github.com/apache/spark)
+ python/pyspark/sql/worker/write_into_data_source.py:157: error: Unused "type: ignore" comment [unused-ignore]
+ python/pyspark/sql/worker/write_into_data_source.py:164: error: Unused "type: ignore" comment [unused-ignore]
+ python/pyspark/sql/worker/create_data_source.py:131: error: Unused "type: ignore" comment [unused-ignore]
+ python/pyspark/sql/worker/create_data_source.py:156: error: Unused "type: ignore" comment [unused-ignore]
+ python/pyspark/sql/worker/create_data_source.py:166: error: Unused "type: ignore" comment [unused-ignore]
+ python/pyspark/sql/worker/create_data_source.py:168: error: Unused "type: ignore" comment [unused-ignore]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/debug/__init__.py:368: error: Unused "type: ignore" comment [unused-ignore]
discord.py (https://github.com/Rapptz/discord.py)
+ discord/utils.py:695: error: Unused "type: ignore" comment [unused-ignore]
+ discord/utils.py:701: error: Incompatible default for argument "check" (default has type "Callable[[object], TypeIs[Awaitable[Any]]]", argument has type "Callable[[T | Awaitable[T]], TypeGuard[Awaitable[T]]]") [assignment]
|
Mostly due to TypeIs changes (python/typeshed#11823). |
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.
Sync typeshed
Source commit:
python/typeshed@f244be9
Note that you will need to close and re-open the PR in order to trigger CI.