Skip to content

Sync typeshed#21232

Merged
hauntsaninja merged 12 commits intomasterfrom
mypybot/sync-typeshed
May 7, 2026
Merged

Sync typeshed#21232
hauntsaninja merged 12 commits intomasterfrom
mypybot/sync-typeshed

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Apr 15, 2026

Sync typeshed

Source commit:
python/typeshed@e4d32e0

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

@github-actions

This comment has been minimized.

mypybot and others added 10 commits May 1, 2026 00:23
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)
The plugin provides superior type checking:
#13987 (comment)
A manual cherry-pick of e437cdf.
@github-actions github-actions Bot force-pushed the mypybot/sync-typeshed branch from 196e129 to 804f674 Compare May 1, 2026 00:23
@brianschubert brianschubert reopened this May 1, 2026
@github-actions

This comment has been minimized.

@hauntsaninja
Copy link
Copy Markdown
Collaborator

False positives come from python/typeshed#15598 and python/typeshed#15601

@hauntsaninja
Copy link
Copy Markdown
Collaborator

Okay, reverted those two PRs

@github-actions

This comment has been minimized.

@hauntsaninja hauntsaninja force-pushed the mypybot/sync-typeshed branch from d14ca76 to 386c3a3 Compare May 7, 2026 02:54
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented May 7, 2026

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

core (https://github.com/home-assistant/core)
+ homeassistant/components/google_generative_ai_conversation/entity.py:175: error: Unused "type: ignore" comment  [unused-ignore]

materialize (https://github.com/MaterializeInc/materialize)
- misc/python/materialize/mzcompose/composition.py:101: note:          def parse_known_args(self, args: Sequence[str] | None = ..., namespace: None = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/mzcompose/composition.py:101: note:          def parse_known_args(self, args: Iterable[str] | None = ..., namespace: None = ...) -> tuple[Namespace, list[str]]
- misc/python/materialize/mzcompose/composition.py:101: note:          def [_N] parse_known_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/mzcompose/composition.py:101: note:          def [_N] parse_known_args(self, args: Iterable[str] | None, namespace: _N) -> tuple[_N, list[str]]
- misc/python/materialize/cli/mzcompose.py:1044: note:          def parse_known_args(self, args: Sequence[str] | None = ..., namespace: None = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/cli/mzcompose.py:1044: note:          def parse_known_args(self, args: Iterable[str] | None = ..., namespace: None = ...) -> tuple[Namespace, list[str]]
- misc/python/materialize/cli/mzcompose.py:1044: note:          def [_N] parse_known_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/cli/mzcompose.py:1044: note:          def [_N] parse_known_args(self, args: Iterable[str] | None, namespace: _N) -> tuple[_N, list[str]]
- misc/python/materialize/cli/mzcompose.py:1056: note:          def parse_known_args(self, args: Sequence[str] | None = ..., namespace: None = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/cli/mzcompose.py:1056: note:          def parse_known_args(self, args: Iterable[str] | None = ..., namespace: None = ...) -> tuple[Namespace, list[str]]
- misc/python/materialize/cli/mzcompose.py:1056: note:          def [_N] parse_known_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/cli/mzcompose.py:1056: note:          def [_N] parse_known_args(self, args: Iterable[str] | None, namespace: _N) -> tuple[_N, list[str]]
- misc/python/materialize/cli/scratch/__main__.py:101: error: Argument "aliases" to "add_parser" of "_SubParsersAction" has incompatible type "str | Callable[[Any], Any] | Callable[[], None] | Callable[[ArgumentParser], None] | Callable[[Namespace], None] | list[str]"; expected "Sequence[str]"  [arg-type]
+ misc/python/materialize/cli/scratch/__main__.py:101: error: Argument "aliases" to "add_parser" of "_SubParsersAction" has incompatible type "str | Callable[[Any], Any] | Callable[[], None] | Callable[[ArgumentParser], None] | Callable[[Namespace], None] | list[str]"; expected "Iterable[str]"  [arg-type]

mitmproxy (https://github.com/mitmproxy/mitmproxy)
+ mitmproxy/utils/strutils.py:125: error: Unused "type: ignore" comment  [unused-ignore]

@hauntsaninja hauntsaninja merged commit 11f945b into master May 7, 2026
24 checks passed
@hauntsaninja hauntsaninja deleted the mypybot/sync-typeshed branch May 7, 2026 03:54
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.

5 participants