Skip to content

Sync typeshed#21232

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

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

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Sync typeshed

Source commit:
python/typeshed@c03c2b9

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

mypybot and others added 10 commits April 15, 2026 00:19
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:

spark (https://github.com/apache/spark)
+ python/pyspark/core/rdd.py:2155: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[float | Literal[0], float | Literal[0]], float | Literal[0]]"  [arg-type]
+ python/pyspark/core/rdd.py:2155: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[complex | Literal[0], complex | Literal[0]], complex | Literal[0]]"  [arg-type]
+ python/pyspark/core/rdd.py:2155: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[signedinteger[_32Bit] | Literal[0], signedinteger[_32Bit] | Literal[0]], signedinteger[_32Bit] | Literal[0]]"  [arg-type]
+ python/pyspark/core/rdd.py:2155: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[signedinteger[_64Bit] | Literal[0], signedinteger[_64Bit] | Literal[0]], signedinteger[_64Bit] | Literal[0]]"  [arg-type]
+ python/pyspark/core/rdd.py:2155: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[floating[_32Bit] | Literal[0], floating[_32Bit] | Literal[0]], floating[_32Bit] | Literal[0]]"  [arg-type]
+ python/pyspark/core/rdd.py:2155: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[float64 | Literal[0], float64 | Literal[0]], float64 | Literal[0]]"  [arg-type]
+ python/pyspark/core/rdd.py:2155: error: Argument 2 to "fold" of "RDD" has incompatible type overloaded function; expected "Callable[[ndarray[tuple[Any, ...], dtype[Any]] | Literal[0], ndarray[tuple[Any, ...], dtype[Any]] | Literal[0]], ndarray[tuple[Any, ...], dtype[Any]] | Literal[0]]"  [arg-type]

colour (https://github.com/colour-science/colour)
+ colour/utilities/array.py:547: error: Cannot call function of unknown type  [operator]
+ colour/io/luts/lut.py:638: error: Cannot call function of unknown type  [operator]
+ colour/continuous/signal.py:1089: error: Cannot call function of unknown type  [operator]

core (https://github.com/home-assistant/core)
+ homeassistant/components/google_generative_ai_conversation/entity.py:177: error: Unused "type: ignore" comment  [unused-ignore]

rotki (https://github.com/rotki/rotki)
+ rotkehlchen/utils/misc.py:199: error: Argument 1 to "sub" has incompatible type "V | Any"; expected "SupportsSub[Any, Any]"  [arg-type]
+ rotkehlchen/utils/misc.py:199: note: Error code "arg-type" not covered by "type: ignore[misc]" comment
+ rotkehlchen/chain/ethereum/oracles/uniswap.py:326: error: Argument 1 to "reduce" has incompatible type overloaded function; expected "Callable[[int, FVal], int]"  [arg-type]

sympy (https://github.com/sympy/sympy)
+ sympy/polys/matrices/dense.py:104: error: Incompatible types in assignment (expression has type "RingElement", target has type "R")  [assignment]

materialize (https://github.com/MaterializeInc/materialize)
- misc/python/materialize/mzcompose/composition.py:101: note:          def parse_known_args(self, args: Sequence[str] | None = ..., namespace: None = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/mzcompose/composition.py:101: note:          def parse_known_args(self, args: Iterable[str] | None = ..., namespace: None = ...) -> tuple[Namespace, list[str]]
- misc/python/materialize/mzcompose/composition.py:101: note:          def [_N] parse_known_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/mzcompose/composition.py:101: note:          def [_N] parse_known_args(self, args: Iterable[str] | None, namespace: _N) -> tuple[_N, list[str]]
- misc/python/materialize/cli/mzcompose.py:1044: note:          def parse_known_args(self, args: Sequence[str] | None = ..., namespace: None = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/cli/mzcompose.py:1044: note:          def parse_known_args(self, args: Iterable[str] | None = ..., namespace: None = ...) -> tuple[Namespace, list[str]]
- misc/python/materialize/cli/mzcompose.py:1044: note:          def [_N] parse_known_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/cli/mzcompose.py:1044: note:          def [_N] parse_known_args(self, args: Iterable[str] | None, namespace: _N) -> tuple[_N, list[str]]
- misc/python/materialize/cli/mzcompose.py:1056: note:          def parse_known_args(self, args: Sequence[str] | None = ..., namespace: None = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/cli/mzcompose.py:1056: note:          def parse_known_args(self, args: Iterable[str] | None = ..., namespace: None = ...) -> tuple[Namespace, list[str]]
- misc/python/materialize/cli/mzcompose.py:1056: note:          def [_N] parse_known_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/cli/mzcompose.py:1056: note:          def [_N] parse_known_args(self, args: Iterable[str] | None, namespace: _N) -> tuple[_N, list[str]]
- misc/python/materialize/cli/scratch/__main__.py:101: error: Argument "aliases" to "add_parser" of "_SubParsersAction" has incompatible type "str | Callable[[Any], Any] | Callable[[], None] | Callable[[ArgumentParser], None] | Callable[[Namespace], None] | list[str]"; expected "Sequence[str]"  [arg-type]
+ misc/python/materialize/cli/scratch/__main__.py:101: error: Argument "aliases" to "add_parser" of "_SubParsersAction" has incompatible type "str | Callable[[Any], Any] | Callable[[], None] | Callable[[ArgumentParser], None] | Callable[[Namespace], None] | list[str]"; expected "Iterable[str]"  [arg-type]

mitmproxy (https://github.com/mitmproxy/mitmproxy)
+ mitmproxy/utils/strutils.py:125: error: Unused "type: ignore" comment  [unused-ignore]

jax (https://github.com/google/jax)
+ jax/experimental/mosaic/gpu/dialect_lowering.py:1416: error: Argument "impl" to "_binary_op_lowering_rule" has incompatible type "function"; expected "Callable[[FragmentedArray, FragmentedArray], FragmentedArray]"  [arg-type]
+ jax/_src/pallas/mosaic_gpu/lowering.py:1091: error: Argument "grid" to "_lower_as_gpu_kernel" has incompatible type "tuple[int, ...]"; expected "tuple[int, int, int]"  [arg-type]

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