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

Sync typeshed #16665

Merged
merged 5 commits into from
Dec 15, 2023
Merged

Sync typeshed #16665

merged 5 commits into from
Dec 15, 2023

Conversation

github-actions[bot]
Copy link
Contributor

Sync typeshed

Source commit:
python/typeshed@b6740d0

Note that you will need to close and re-open the PR in order to trigger CI.

mypybot and others added 5 commits December 15, 2023 00:05
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)
Since the plugin provides superior type checking: #13987 (comment)
A manual cherry-pick of e437cdf.
@AlexWaygood AlexWaygood reopened this Dec 15, 2023
Copy link
Contributor Author

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

pip (https://github.com/pypa/pip)
+ src/pip/_internal/metadata/_json.py:82: error: Incompatible types in assignment (expression has type "Message | Any | str | list[Message | str]", target has type "str | list[str]")  [assignment]

websockets (https://github.com/aaugustin/websockets)
+ src/websockets/legacy/async_timeout.py:239: error: Argument 1 to "call_soon" of "AbstractEventLoop" has incompatible type "Callable[[Task[None]], None]"; expected "Callable[[Task[Any] | None], object]"  [arg-type]
+ src/websockets/legacy/async_timeout.py:241: error: Argument 2 to "call_at" of "AbstractEventLoop" has incompatible type "Callable[[Task[None]], None]"; expected "Callable[[Task[Any] | None], object]"  [arg-type]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/platform/asyncio.py:705: error: Argument 3 of "add_reader" is incompatible with supertype "AbstractEventLoop"; supertype defines the argument type as "Unpack[_Ts]"  [override]
+ tornado/platform/asyncio.py:705: note: This violates the Liskov substitution principle
+ tornado/platform/asyncio.py:705: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
+ tornado/platform/asyncio.py:710: error: Argument 3 of "add_writer" is incompatible with supertype "AbstractEventLoop"; supertype defines the argument type as "Unpack[_Ts]"  [override]
+ tornado/platform/asyncio.py:710: note: This violates the Liskov substitution principle
+ tornado/platform/asyncio.py:710: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides

graphql-core (https://github.com/graphql-python/graphql-core)
+ src/graphql/execution/execute.py:40: error: Unused "type: ignore" comment  [unused-ignore]

@hauntsaninja hauntsaninja merged commit 43ffb49 into master Dec 15, 2023
18 checks passed
@hauntsaninja hauntsaninja deleted the mypybot/sync-typeshed branch December 15, 2023 03:32
@cdce8p cdce8p mentioned this pull request Dec 15, 2023
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.

2 participants