Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug that results in incorrect protocol matching behaviors und… #9182

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

erictraut
Copy link
Collaborator

…er certain circumstances.

Copy link
Contributor

github-actions bot commented Oct 9, 2024

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

sympy (https://github.com/sympy/sympy)
+   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1127:39 - error: Cannot access attribute "items" for class "type[type[Order]]"
+     Attribute "items" is unknown (reportAttributeAccessIssue)
-   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1143:26 - error: Argument of type "Any | type[None] | type[Unknown] | type[type[Unknown]] | dict[Unknown, Unknown]" cannot be assigned to parameter "iterable" of type "Iterable[list[bytes]]" in function "__init__"
+   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1143:26 - error: Argument of type "Any | type[None] | type[Unknown] | type[type[Unknown]] | type[type[Order]] | dict[Unknown, Unknown]" cannot be assigned to parameter "iterable" of type "Iterable[list[bytes]]" in function "__init__"
-     Type "Any | type[None] | type[Unknown] | type[type[Unknown]] | dict[Unknown, Unknown]" is not assignable to type "Iterable[list[bytes]]"
+     Type "Any | type[None] | type[Unknown] | type[type[Unknown]] | type[type[Order]] | dict[Unknown, Unknown]" is not assignable to type "Iterable[list[bytes]]"
+   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1145:28 - error: Expected no type arguments for class "Order" (reportInvalidTypeArguments)
-   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1148:26 - error: Argument of type "Any | type[None] | type[Unknown] | type[type[Unknown]] | dict[Unknown, Unknown]" cannot be assigned to parameter "iterable" of type "Iterable[list[bytes]]" in function "__init__"
+   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1148:26 - error: Argument of type "Any | type[None] | type[Unknown] | type[type[Unknown]] | type[type[Order]] | dict[Unknown, Unknown]" cannot be assigned to parameter "iterable" of type "Iterable[list[bytes]]" in function "__init__"
-     Type "Any | type[None] | type[Unknown] | type[type[Unknown]] | dict[Unknown, Unknown]" is not assignable to type "Iterable[list[bytes]]"
+     Type "Any | type[None] | type[Unknown] | type[type[Unknown]] | type[type[Order]] | dict[Unknown, Unknown]" is not assignable to type "Iterable[list[bytes]]"
+   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1150:28 - error: Expected no type arguments for class "Order" (reportInvalidTypeArguments)
+     Attribute "items" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1153:28 - error: Cannot access attribute "items" for class "type[type[Order]]"
+   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1158:28 - error: Cannot access attribute "items" for class "type[type[Order]]"
+     Attribute "items" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1163:12 - error: Cannot access attribute "update" for class "type[type[Order]]"
+     Attribute "update" is unknown (reportAttributeAccessIssue)
+     Attribute "values" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1165:30 - error: Cannot access attribute "values" for class "type[type[Order]]"
-   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1179:26 - error: Operator "*" not supported for types "list[Unknown]" and "Any | type[None] | Unknown | type[type[Unknown]]"
+   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1179:26 - error: Operator "*" not supported for types "list[Unknown]" and "Any | type[None] | Unknown | type[type[Unknown]] | type[type[Order]]"
+     Operator "*" not supported for types "list[Unknown]" and "type[type[Unknown]]" when expected type is "Iterable[Unknown]"
-     Operator "*" not supported for types "list[Unknown]" and "type[type[Unknown]]" when expected type is "Iterable[Unknown]" (reportOperatorIssue)
+     Operator "*" not supported for types "list[Unknown]" and "type[type[Order]]" when expected type is "Iterable[Unknown]" (reportOperatorIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/polys/polyroots.py:1179:40 - error: Expected no type arguments for class "Order" (reportInvalidTypeArguments)
+   /tmp/mypy_primer/projects/sympy/sympy/polys/numberfields/tests/test_primes.py:36:14 - error: "type[type[type[int]]]" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/sympy/sympy/polys/numberfields/tests/test_primes.py:58:14 - error: "type[type[type[int]]]" is not iterable
+   /tmp/mypy_primer/projects/sympy/sympy/polys/numberfields/tests/test_utilities.py:20:41 - error: Expected no type arguments for class "int" (reportInvalidTypeArguments)
+   /tmp/mypy_primer/projects/sympy/sympy/polys/numberfields/tests/test_utilities.py:24:26 - error: Expected no type arguments for class "int" (reportInvalidTypeArguments)
+   /tmp/mypy_primer/projects/sympy/sympy/polys/numberfields/tests/test_utilities.py:25:22 - error: Expected no type arguments for class "int" (reportInvalidTypeArguments)
+   /tmp/mypy_primer/projects/sympy/sympy/polys/numberfields/tests/test_utilities.py:25:40 - error: Expected no type arguments for class "int" (reportInvalidTypeArguments)
+   /tmp/mypy_primer/projects/sympy/sympy/polys/numberfields/tests/test_utilities.py:27:29 - error: Expected no type arguments for class "int" (reportInvalidTypeArguments)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/ode/hypergeometric.py:105:15 - error: Cannot access attribute "is_rational_function" for class "type[type[bool]]"
+     Attribute "is_rational_function" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/ode/hypergeometric.py:105:15 - error: Cannot access attribute "is_rational_function" for class "type[type[Basic]]"
+     Attribute "is_rational_function" is unknown (reportAttributeAccessIssue)
+     Attribute "as_numer_denom" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/ode/hypergeometric.py:108:19 - error: Cannot access attribute "as_numer_denom" for class "type[type[bool]]"
+     Attribute "as_numer_denom" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/ode/hypergeometric.py:108:19 - error: Cannot access attribute "as_numer_denom" for class "type[type[Basic]]"
- 81647 errors, 1227 warnings, 0 informations 
+ 81666 errors, 1227 warnings, 0 informations 

kopf (https://github.com/nolar/kopf)
+   /tmp/mypy_primer/projects/kopf/kopf/_core/reactor/running.py:336:27 - error: Argument of type "partial[Coroutine[Any, Any, None]]" cannot be assigned to parameter "processor" of type "WatchStreamProcessor" in function "ochestrator"
+     "partial[Coroutine[Any, Any, None]]" is incompatible with protocol "WatchStreamProcessor"
+       "__call__" is an incompatible type
+         Type "(resource: Resource, raw_event: RawEvent, stream_pressure: Event | None = ..., resource_indexed: Toggle | None = ..., operator_indexed: ToggleSet | None = ..., lifecycle: LifeCycleFn = ..., indexers: OperatorIndexers = ..., registry: OperatorRegistry = ..., settings: OperatorSettings = ..., memories: ResourceMemories = ..., memobase: AnyMemo = ..., event_queue: K8sEventQueue = ...) -> Coroutine[Any, Any, None]" is not assignable to type "(*, raw_event: RawEvent, stream_pressure: Event | None = None, resource_indexed: Toggle | None = None, operator_indexed: ToggleSet | None = None) -> Coroutine[Any, Any, None]"
+           Extra parameter "resource" (reportArgumentType)
- 1167 errors, 19 warnings, 0 informations 
+ 1168 errors, 19 warnings, 0 informations 

jax (https://github.com/google/jax)
+   /tmp/mypy_primer/projects/jax/jax/_src/lax/control_flow/conditionals.py:1016:7 - error: Argument of type "partial[Sequence[Unknown]]" cannot be assigned to parameter "value" of type "LoweringRule" in function "__setitem__"
+     "partial[Sequence[Unknown]]" is incompatible with protocol "LoweringRule"
+       "__call__" is an incompatible type
+         Type "(ctx: LoweringRuleContext, ..., i: int = ...) -> Sequence[Unknown]" is not assignable to type "(ctx: LoweringRuleContext, *args: Unknown | Sequence[Unknown], **kw: Unknown) -> Sequence[Unknown | Sequence[Unknown]]"
+           Parameter "*args" has no corresponding parameter
+           Parameter "**kw" has no corresponding parameter (reportArgumentType)
+   /tmp/mypy_primer/projects/jax/jax/_src/lax/control_flow/conditionals.py:1023:21 - error: Argument of type "partial[Sequence[Unknown]] | None" cannot be assigned to parameter "default_rule" of type "LoweringRule | None" in function "lower_per_platform"
+     Type "partial[Sequence[Unknown]] | None" is not assignable to type "LoweringRule | None"
+       Type "partial[Sequence[Unknown]]" is not assignable to type "LoweringRule | None"
+         "partial[Sequence[Unknown]]" is incompatible with protocol "LoweringRule"
+           "__call__" is an incompatible type
+             Type "(ctx: LoweringRuleContext, ..., i: int = ...) -> Sequence[Unknown]" is not assignable to type "(ctx: LoweringRuleContext, *args: Unknown | Sequence[Unknown], **kw: Unknown) -> Sequence[Unknown | Sequence[Unknown]]"
+         "partial[Sequence[Unknown]]" is not assignable to "None" (reportArgumentType)
- 6428 errors, 26 warnings, 0 informations 
+ 6430 errors, 26 warnings, 0 informations 

@erictraut erictraut merged commit 631c527 into main Oct 9, 2024
18 checks passed
@erictraut erictraut deleted the protoCache2 branch October 9, 2024 02:22
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