Skip to content

Sync typeshed#21124

Open
github-actions[bot] wants to merge 9 commits intomasterfrom
mypybot/sync-typeshed
Open

Sync typeshed#21124
github-actions[bot] wants to merge 9 commits intomasterfrom
mypybot/sync-typeshed

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 1, 2026

Sync typeshed

Source commit:
python/typeshed@c5e47fa

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

mypybot and others added 9 commits April 1, 2026 00:14
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
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 1, 2026

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

meson (https://github.com/mesonbuild/meson)
+ mesonbuild/cmdline.py:46:5: error: Signature of "read" incompatible with supertype "configparser.RawConfigParser"  [override]
+ mesonbuild/cmdline.py:46:5: note:      Superclass:
+ mesonbuild/cmdline.py:46:5: note:          @overload
+ mesonbuild/cmdline.py:46:5: note:          def [AnyStr: (str, bytes)] read(self, filenames: AnyStr | PathLike[AnyStr], encoding: str = ...) -> list[AnyStr]
+ mesonbuild/cmdline.py:46:5: note:          @overload
+ mesonbuild/cmdline.py:46:5: note:          def read(self, filenames: Iterable[str | PathLike[str]], encoding: str | None = ...) -> list[str]
+ mesonbuild/cmdline.py:46:5: note:          @overload
+ mesonbuild/cmdline.py:46:5: note:          def read(self, filenames: Iterable[bytes | PathLike[bytes]], encoding: str | None = ...) -> list[bytes]
+ mesonbuild/cmdline.py:46:5: note:          @overload
+ mesonbuild/cmdline.py:46:5: note:          def read(self, filenames: Iterable[str | bytes | PathLike[str] | PathLike[bytes]], encoding: str | None = ...) -> list[str | bytes]
+ mesonbuild/cmdline.py:46:5: note:      Subclass:
+ mesonbuild/cmdline.py:46:5: note:          def read(self, filenames: str | bytes | PathLike[str] | PathLike[bytes] | Iterable[str | bytes | PathLike[str] | PathLike[bytes]], encoding: str | None = ...) -> list[str]
+ mesonbuild/cmdline.py:47:29: error: Argument 1 to "read" of "RawConfigParser" has incompatible type "str | bytes | PathLike[str] | PathLike[bytes] | Iterable[str | bytes | PathLike[str] | PathLike[bytes]]"; expected "str | PathLike[str]"  [arg-type]

@hauntsaninja
Copy link
Copy Markdown
Collaborator

primer is python/typeshed#15551

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.

4 participants