Skip to content

Fixed issue that prevents typeshed from eliminating `typing._TypedDic…#11083

Merged
erictraut merged 2 commits intomainfrom
issue11081
Nov 2, 2025
Merged

Fixed issue that prevents typeshed from eliminating `typing._TypedDic…#11083
erictraut merged 2 commits intomainfrom
issue11081

Conversation

@erictraut
Copy link
Collaborator

…t`. This addresses #11081.

@github-actions

This comment has been minimized.

@erictraut erictraut merged commit 8d9df83 into main Nov 2, 2025
19 checks passed
@erictraut erictraut deleted the issue11081 branch November 2, 2025 00:53
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

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

sympy (https://github.com/sympy/sympy)
-   .../projects/sympy/sympy/solvers/deutils.py:233:14 - error: Operator "not in" not supported for types "str" and "Unknown | int"
-     Operator "not in" not supported for types "str" and "int" (reportOperatorIssue)
-   .../projects/sympy/sympy/solvers/ode/ode.py:1370:17 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "value" of type "Zero" in function "__setitem__"
+   .../projects/sympy/sympy/solvers/ode/ode.py:1370:17 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "value" of type "Zero" in function "__setitem__"
-     Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "Zero"
+     Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "Zero"
-   .../projects/sympy/sympy/solvers/ode/ode.py:2899:17 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "value" of type "Zero" in function "__setitem__"
+   .../projects/sympy/sympy/solvers/ode/ode.py:2899:17 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "value" of type "Zero" in function "__setitem__"
-     Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "Zero"
+     Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "Zero"
-   .../projects/sympy/sympy/solvers/ode/single.py:2365:23 - error: Argument of type "dict[str, Equality | BooleanFalse | BooleanTrue | bool | list[Unknown]]" cannot be assigned to parameter "m" of type "Iterable[tuple[int, One | Zero | Expr]]" in function "update"
+   .../projects/sympy/sympy/solvers/ode/single.py:2365:23 - error: Argument of type "dict[str, Equality | BooleanFalse | BooleanTrue | bool | list[Unknown]]" cannot be assigned to parameter "m" of type "Iterable[tuple[int, One | Zero | Expr | Unknown | NegativeOne | Integer | NaN | ComplexInfinity | Rational]]" in function "update"
-     "Literal['list']" is not assignable to "tuple[int, One | Zero | Expr]"
-     "Literal['sol']" is not assignable to "tuple[int, One | Zero | Expr]"
-     "Literal['simpliy_flag']" is not assignable to "tuple[int, One | Zero | Expr]" (reportArgumentType)
+     "Literal['list']" is not assignable to "tuple[int, One | Zero | Expr | Unknown | NegativeOne | Integer | NaN | ComplexInfinity | Rational]"
+     "Literal['sol']" is not assignable to "tuple[int, One | Zero | Expr | Unknown | NegativeOne | Integer | NaN | ComplexInfinity | Rational]"
+     "Literal['simpliy_flag']" is not assignable to "tuple[int, One | Zero | Expr | Unknown | NegativeOne | Integer | NaN | ComplexInfinity | Rational]" (reportArgumentType)
-   .../projects/sympy/sympy/solvers/ode/single.py:2636:27 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "stop" of type "SupportsIndex" in function "__new__"
+   .../projects/sympy/sympy/solvers/ode/single.py:2636:27 - error: Argument of type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Infinity | NegativeInfinity | Float | Number | Expr" cannot be assigned to parameter "stop" of type "SupportsIndex" in function "__new__"
-     Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "SupportsIndex"
+     Type "One | NegativeOne | Zero | Integer | NaN | ComplexInfinity | Rational | Unknown | Infinity | NegativeInfinity | Float | Number | Expr" is not assignable to type "SupportsIndex"
-   .../projects/sympy/sympy/solvers/ode/systems.py:1213:26 - error: Argument of type "dict[str, str | Unknown | Pow | bool | Symbol]" cannot be assigned to parameter "m" of type "Iterable[tuple[str, str]]" in function "update"
+   .../projects/sympy/sympy/solvers/ode/systems.py:1213:26 - error: Argument of type "dict[str, str | Unknown | Expr | bool | Symbol]" cannot be assigned to parameter "m" of type "Iterable[tuple[str, str]]" in function "update"
+   .../projects/sympy/sympy/solvers/recurr.py:239:17 - error: No overloads for "__setitem__" match the provided arguments (reportCallIssue)
+   .../projects/sympy/sympy/solvers/recurr.py:239:17 - error: Argument of type "Unknown | NaN | Expr | Infinity | NegativeInfinity | Zero | Float" cannot be assigned to parameter "value" of type "One" in function "__setitem__"
+     Type "Unknown | NaN | Expr | Infinity | NegativeInfinity | Zero | Float" is not assignable to type "One"
+       "Expr" is not assignable to "One" (reportArgumentType)
-   .../projects/sympy/sympy/solvers/recurr.py:423:16 - error: Cannot access attribute "is_polynomial" for class "tuple[Unknown, list[Expr | Unknown]]"
-     Attribute "is_polynomial" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/solvers/recurr.py:423:16 - error: Cannot access attribute "is_polynomial" for class "tuple[Unknown | tuple[Unknown, list[Poly]], list[Poly] | Unknown | Unbound]"
-     Attribute "is_polynomial" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/solvers/recurr.py:423:16 - error: Cannot access attribute "is_polynomial" for class "tuple[Unknown, list[Poly]]"
-     Attribute "is_polynomial" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/solvers/recurr.py:424:20 - error: Cannot access attribute "as_numer_denom" for class "tuple[Unknown, list[Expr | Unknown]]"
-     Attribute "as_numer_denom" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/solvers/recurr.py:424:20 - error: Cannot access attribute "as_numer_denom" for class "tuple[Unknown | tuple[Unknown, list[Poly]], list[Poly] | Unknown | Unbound]"
-     Attribute "as_numer_denom" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/solvers/recurr.py:424:20 - error: Cannot access attribute "as_numer_denom" for class "tuple[Unknown, list[Poly]]"
-     Attribute "as_numer_denom" is unknown (reportAttributeAccessIssue)
+   .../projects/sympy/sympy/solvers/recurr.py:798:40 - error: Cannot access attribute "expand" for class "Basic"
+     Attribute "expand" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/solvers/solvers.py:3104:17 - error: No overloads for "__init__" match the provided arguments (reportCallIssue)
-   .../projects/sympy/sympy/solvers/solvers.py:3104:22 - error: Argument of type "zip[Unknown]" cannot be assigned to parameter "iterable" of type "Iterable[list[bytes]]" in function "__init__"
-     "zip[Unknown]" is incompatible with protocol "Iterable[list[bytes]]"
-       "__iter__" is an incompatible type
-         Type "() -> zip[Unknown]" is not assignable to type "() -> Iterator[_T_co@Iterable]"
-           Function return type "zip[Unknown]" is incompatible with type "Iterator[_T_co@Iterable]"
-             "zip[Unknown]" is incompatible with protocol "Iterator[_T_co@Iterable]" (reportArgumentType)
-   .../projects/sympy/sympy/solvers/solvers.py:3185:17 - error: Operator "-=" not supported for types "Zero | Unknown | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | _NotImplementedType | Expr | float | Any | One | NegativeOne | Integer | Number | Basic" and "Expr | Unknown"
+   .../projects/sympy/sympy/solvers/solvers.py:3185:17 - error: Operator "-=" not supported for types "Zero | Unknown | Expr | Float | One | NegativeOne | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Number | Basic" and "Expr | Unknown"
-   .../projects/sympy/sympy/solvers/solvers.py:3263:34 - error: Cannot access attribute "func" for class "float"
-     Attribute "func" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/solvers/solvers.py:3264:45 - error: Cannot access attribute "args" for class "float"
-     Attribute "args" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/solvers/solvers.py:3266:31 - error: Cannot access attribute "args" for class "float"
-     Attribute "args" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/solvers/solvers.py:3267:47 - error: Cannot access attribute "args" for class "float"
-     Attribute "args" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/solvers/solvers.py:3280:19 - error: Operator "/" not supported for types "Literal[1]" and "Unknown | Zero | Float | _NotImplementedType | float | Any | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Expr | One | NegativeOne | Integer | Number | Basic"
+   .../projects/sympy/sympy/solvers/solvers.py:3280:19 - error: Operator "/" not supported for types "Literal[1]" and "Unknown | Zero | Float | Expr | One | NegativeOne | Integer | NaN | ComplexInfinity | Rational | Infinity | NegativeInfinity | Number | Basic"
-   .../projects/sympy/sympy/solvers/solveset.py:986:43 - error: Cannot access attribute "p" for class "NaN"
-     Attribute "p" is unknown (reportAttributeAccessIssue)
-   .../projects/sympy/sympy/solvers/solveset.py:986:43 - error: Cannot access attribute "p" for class "ComplexInfinity"
-     Attribute "p" is unknown (reportAttributeAccessIssue)

... (truncated 248 lines) ...

AutoSplit (https://github.com/Toufool/AutoSplit)
-   .../projects/AutoSplit/src/user_profile.py:52:9 - error: Method "copy" is not marked as override but is overriding a method in class "_TypedDict" (reportImplicitOverride)
+   .../projects/AutoSplit/src/user_profile.py:52:9 - error: Method "copy" is not marked as override but is overriding a method in class "TypedDictFallback" (reportImplicitOverride)

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.

1 participant