Skip to content

Sync typeshed - #22372

Merged
hauntsaninja merged 12 commits into
python:masterfrom
cdce8p:sync-typeshed
Nov 5, 2026
Merged

hauntsaninja merged 12 commits into
python:masterfrom
cdce8p:sync-typeshed

Conversation

@cdce8p

@cdce8p cdce8p commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Source commit:
python/typeshed@dac770d

cdce8p and others added 10 commits November 5, 2026 00:04
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:
python#13987 (comment)
A manual cherry-pick of e437cdf.
@github-actions

This comment has been minimized.

@cdce8p

cdce8p commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

Mypy primer hits

--
I haven't checked it in detail but it looks like almost all changed messages are somewhat related t that single PR.

@cdce8p
cdce8p requested a review from hauntsaninja November 4, 2026 23:53
@JukkaL

JukkaL commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

A lot of these are about datetime vs datetime[Any], which is fine. But some others may be regressions.

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@ilevkivskyi

Copy link
Copy Markdown
Member

Btw is this essentially a fix for #10067 (which is the sixth most upvoted issues)?

@cdce8p

cdce8p commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

A lot of these are about datetime vs datetime[Any], which is fine. But some others may be regressions.

I just added a temporary patch to compare the primer output. Looks like all messages were a result of python/typeshed#11844.

My suggestion would be to merge this one as is and I'm going to open a followup PR where I remove the patch again.

@hauntsaninja hauntsaninja left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to do that, makes sense to consider the datetime change on its own!

@hauntsaninja
hauntsaninja merged commit 0719acc into python:master Nov 5, 2026
25 checks passed
@cdce8p
cdce8p deleted the sync-typeshed branch November 5, 2026 21:13
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