Skip to content

Sync typeshed - #22487

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

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

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Sync typeshed

Source commit:
python/typeshed@37e85d1

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

mypybot and others added 11 commits November 15, 2026 00:07
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

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

mypy (https://github.com/python/mypy)
+ mypyc/analysis/attrdefined.py:213: error: "AbstractSet[str]" has no attribute "discard"  [attr-defined]
+ mypyc/analysis/attrdefined.py:223: error: "AbstractSet[str]" has no attribute "discard"  [attr-defined]
+ mypyc/analysis/attrdefined.py:240: error: Incompatible return value type (got "AbstractSet[str]", expected "set[str]")  [return-value]
+ mypyc/analysis/attrdefined.py:256: error: Incompatible types in assignment (expression has type "AbstractSet[str]", variable has type "set[str]")  [assignment]
+ mypyc/analysis/attrdefined.py:261: error: Incompatible types in assignment (expression has type "AbstractSet[str]", variable has type "set[str]")  [assignment]

core (https://github.com/home-assistant/core)
+ homeassistant/helpers/device_registry.py:273: error: Incompatible types in assignment (expression has type "set[str]", variable has type "frozenset[str]")  [assignment]

pytest-autoprofile (https://gitlab.com/TTsangSC/pytest-autoprofile)
+ src/pytest_autoprofile/importers.py:343: error: Unused "type: ignore" comment  [unused-ignore]

CPython (peg_generator) (https://github.com/python/cpython)
+ Tools/peg_generator/pegen/grammar_analysis.py:123: error: Result type of - incompatible in assignment  [misc]

pegen (https://github.com/we-like-parsers/pegen)
+ src/pegen/grammar.py:180: error: Result type of | incompatible in assignment  [misc]
+ src/pegen/grammar.py:215: error: Result type of | incompatible in assignment  [misc]
+ src/pegen/parser_generator.py:255: error: Result type of - incompatible in assignment  [misc]
+ src/pegen/parser_generator.py:283: error: Result type of | incompatible in assignment  [misc]

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/ext/coverage.py: note: In function "_load_modules":
+ sphinx/ext/coverage.py:101:13: error: Result type of | incompatible in assignment  [misc]
+ sphinx/ext/coverage.py: note: In function "_determine_py_coverage_modules":
+ sphinx/ext/coverage.py:137:13: error: Result type of | incompatible in assignment  [misc]

@cdce8p

cdce8p commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

The mypy self check failures are caused by the changes to set and AbstractSet in python/typeshed#16634.

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.

3 participants