Skip to content

Sync typeshed - #21799

Open
cdce8p wants to merge 13 commits into
python:masterfrom
cdce8p:sync-typeshed
Open

Sync typeshed#21799
cdce8p wants to merge 13 commits into
python:masterfrom
cdce8p:sync-typeshed

Conversation

@cdce8p

@cdce8p cdce8p commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Source commit:
python/typeshed@7ee1807

cdce8p and others added 12 commits August 2, 2026 12: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.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

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

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/web.py:554:24: error: Name "module" may be undefined  [possibly-undefined]
+ aiohttp/web.py:554:24: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-possibly-undefined for more info
+ aiohttp/web.py:572:11: error: Name "func" may be undefined  [possibly-undefined]
- aiohttp/worker.py:253:9: error: function asyncio.events.set_event_loop_policy is deprecated: Deprecated since Python 3.14; will be removed in Python 3.16.  [deprecated]
+ aiohttp/worker.py:253:9: error: function asyncio.events.set_event_loop_policy is deprecated: Deprecated; will be removed in Python 3.16.  [deprecated]

mypy (https://github.com/python/mypy)
+ mypy/main.py:479: error: Implicit return in function which does not return  [misc]

comtypes (https://github.com/enthought/comtypes)
- comtypes/server/register.py:226: error: Incompatible types in assignment (expression has type "Iterator[tuple[int, str]]", variable has type "list[tuple[int, str]]")  [assignment]
+ comtypes/server/register.py:226: error: Incompatible types in assignment (expression has type "reversed[tuple[int, str]]", variable has type "list[tuple[int, str]]")  [assignment]

pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/commands/p2p.py: note: In function "address_range_explicit":
+ pwndbg/commands/p2p.py:29: error: Missing return statement  [return]
+ pwndbg/commands/p2p.py: note: In function "address_range":
+ pwndbg/commands/p2p.py:41: error: Missing return statement  [return]

discord.py (https://github.com/Rapptz/discord.py)
- discord/abc.py:1815: error: Incompatible types in assignment (expression has type "Iterator[MessagePin]", variable has type "list[MessagePin]")  [assignment]
+ discord/abc.py:1815: error: Incompatible types in assignment (expression has type "reversed[MessagePin]", variable has type "list[MessagePin]")  [assignment]

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/monkeypatch.py:417: error: Unused "type: ignore" comment  [unused-ignore]
+ src/_pytest/monkeypatch.py:422: error: Unused "type: ignore" comment  [unused-ignore]

jinja (https://github.com/pallets/jinja)
+ src/jinja2/utils.py:570: error: Returning Any from function declared to return "Iterator[Any]"  [no-any-return]

materialize (https://github.com/MaterializeInc/materialize)
+ misc/python/materialize/cli/ci_failures.py:134: error: Argument "token" to "fetch_failures" has incompatible type "str | None"; expected "str"  [arg-type]

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/cmd/build.py: note: In function "_parse_logging":
+ sphinx/cmd/build.py:358:41: error: Argument 2 to "TeeStripANSI" has incompatible type "TextIOWrapper[_WrappedBuffer] | None"; expected "SupportsWrite"  [arg-type]
+ sphinx/cmd/build.py:358:41: note: Error code "arg-type" not covered by "type: ignore[assignment]" comment
+ sphinx/cmd/build.py: note: At top level:

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