Skip to content

Sync typeshed#21665

Open
github-actions[bot] wants to merge 11 commits into
masterfrom
mypybot/sync-typeshed
Open

Sync typeshed#21665
github-actions[bot] wants to merge 11 commits into
masterfrom
mypybot/sync-typeshed

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Sync typeshed

Source commit:
python/typeshed@b9090e9

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

mypybot and others added 11 commits July 1, 2026 00:31
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.
@A5rocks A5rocks closed this Jul 1, 2026
@A5rocks A5rocks reopened this Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

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

strawberry (https://github.com/strawberry-graphql/strawberry)
+ strawberry/types/object_type.py:295: error: Value of type variable "T" of "_inject_default_for_maybe_annotations" cannot be "object"  [type-var]
+ strawberry/types/object_type.py:296: error: Value of type variable "T" of "_wrap_dataclass" cannot be "object"  [type-var]

hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
+ src/hydra_zen/third_party/beartype.py:125: error: Cannot assign to a method  [method-assign]

scrapy (https://github.com/scrapy/scrapy)
+ scrapy/cmdline.py:70: error: Incompatible types in assignment (expression has type "object", target has type "ScrapyCommand")  [assignment]

pandera (https://github.com/pandera-dev/pandera)
+ pandera/dtypes.py:568: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/pandas/test_dtypes.py:306: error: Item "object" of "Any | object" has no attribute "foo"  [union-attr]

trio (https://github.com/python-trio/trio)
+ src/trio/_core/_tests/test_ki.py:682: error: Argument 1 to "_consume_async_generator" has incompatible type "AsyncGeneratorType[object, Never]"; expected "AsyncGenerator[None, None]"  [arg-type]
+ src/trio/_core/_tests/test_ki.py:687: error: Argument 1 to "send" of "GeneratorType" has incompatible type "None"; expected "Never"  [arg-type]

pytest (https://github.com/pytest-dev/pytest)
+ testing/test_monkeypatch.py:439: error: Statement is unreachable  [unreachable]

graphql-core (https://github.com/graphql-python/graphql-core)
+ tests/execution/test_middleware.py:265: error: "object" has no attribute "data"  [attr-defined]
+ tests/execution/test_middleware.py:267: error: "object" has no attribute "data"  [attr-defined]

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