Skip to content

Removed some circular module dependencies.#10485

Merged
erictraut merged 2 commits intomainfrom
dependencies1
May 21, 2025
Merged

Removed some circular module dependencies.#10485
erictraut merged 2 commits intomainfrom
dependencies1

Conversation

@erictraut
Copy link
Collaborator

No description provided.

@debonte
Copy link
Contributor

debonte commented May 21, 2025

@erictraut, would you mind holding off on merging this for a little bit? I'd like to finish the pull of pyright into pylance before any additional commits occur on top of yesterday's release.

@github-actions

This comment has been minimized.

@erictraut
Copy link
Collaborator Author

@debonte, yeah, I can hold off. Let me know when you're done.

@debonte
Copy link
Contributor

debonte commented May 21, 2025

Thanks. Btw, #10486 is not what I'm talking about. I need to do the pull in to pyrx manually since there's a merge conflict.

@debonte
Copy link
Contributor

debonte commented May 21, 2025

@erictraut, ok, I'm done with the pull into pyrx. Feel free to merge this.

@github-actions
Copy link
Contributor

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

sympy (https://github.com/sympy/sympy)
-   ...:540:50 - error: "Set" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
+   ...:2542:9 - error: Method "_cdf" overrides class "SingleContinuousDistribution" in an incompatible manner
+     Return type mismatch: base method returns type "None", override returns type "ComplexInfinity | NaN | Rational | Unknown"
+       Type "ComplexInfinity | NaN | Rational | Unknown" is not assignable to type "None"
+         "ComplexInfinity" is not assignable to "None" (reportIncompatibleMethodOverride)
+   ...:2721:9 - error: Method "_cdf" overrides class "SingleContinuousDistribution" in an incompatible manner
+     Return type mismatch: base method returns type "None", override returns type "Expr | NaN | ComplexInfinity | Rational | Unknown"
+       Type "Expr | NaN | ComplexInfinity | Rational | Unknown" is not assignable to type "None"
+         "Expr" is not assignable to "None" (reportIncompatibleMethodOverride)
-   ...:261:48 - error: Cannot access attribute "doit" for class "tuple[Unknown, ...]"
-     Attribute "doit" is unknown (reportAttributeAccessIssue)
-   ...:261:48 - error: "doit" is not a known attribute of "None" (reportOptionalMemberAccess)
-   ...:268:22 - error: Argument of type "Generator[tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Basic | int | None, None, None]" cannot be assigned to parameter "iterable" of type "Iterable[_SupportsSumNoDefaultT@sum]" in function "sum"
+   ...:268:22 - error: Argument of type "Generator[Unknown | int | None, None, None]" cannot be assigned to parameter "iterable" of type "Iterable[_SupportsSumNoDefaultT@sum]" in function "sum"
-     "Generator[tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Basic | int | None, None, None]" is not assignable to "Iterable[_SupportsSumNoDefaultT@sum]"
+     "Generator[Unknown | int | None, None, None]" is not assignable to "Iterable[_SupportsSumNoDefaultT@sum]"
-       Type parameter "_T_co@Iterable" is covariant, but "tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Basic | int | None" is not a subtype of "_SupportsSumNoDefaultT@sum"
+       Type parameter "_T_co@Iterable" is covariant, but "Unknown | int | None" is not a subtype of "_SupportsSumNoDefaultT@sum"
-         Type "tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Basic | int | None" is not assignable to type "_SupportsSumWithNoDefaultGiven"
+         Type "Unknown | int | None" is not assignable to type "_SupportsSumWithNoDefaultGiven"
-           Type "tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Basic | int | None" is not assignable to type "_SupportsSumWithNoDefaultGiven"
+           Type "Unknown | int | None" is not assignable to type "_SupportsSumWithNoDefaultGiven"
-             "Basic" is incompatible with protocol "_SupportsSumWithNoDefaultGiven" (reportArgumentType)
+             "None" is incompatible with protocol "_SupportsSumWithNoDefaultGiven" (reportArgumentType)
+   ...:138:17 - error: Argument of type "NaN | ComplexInfinity | Rational | Unknown | Expr" cannot be assigned to parameter "value" of type "int" in function "__setitem__"
+     Type "NaN | ComplexInfinity | Rational | Unknown | Expr" is not assignable to type "int"
+       "Expr" is not assignable to "int" (reportArgumentType)
-   ...:473:25 - error: Argument of type "Expr | Lambda | Zero | One | Integral | Unknown | Probability | tuple[Unknown, ...] | Sum | NaN | Piecewise | Basic | NegativeOne | Integer | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | int" cannot be assigned to parameter "args" of type "Expr | complex" in function "__new__"
-     Type "Expr | Lambda | Zero | One | Integral | Unknown | Probability | tuple[Unknown, ...] | Sum | NaN | Piecewise | Basic | NegativeOne | Integer | ComplexInfinity | Rational | Infinity | NegativeInfinity | Float | Number | int" is not assignable to type "Expr | complex"
-       Type "Basic" is not assignable to type "Expr | complex"
-         "Basic" is not assignable to "Expr"
-         "Basic" is not assignable to "complex" (reportArgumentType)
-   ...:741:20 - error: "Set" is not iterable
-     "__iter__" method not defined (reportGeneralTypeIssues)
-   ...:1839:25 - error: Argument of type "tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Basic | Integral | Any | int | None" cannot be assigned to parameter "args" of type "Expr | complex" in function "__new__"
+   ...:1839:25 - error: Argument of type "tuple[Unknown, ...] | Unknown | Sum | Expr | Any | Add | Zero | NaN | Piecewise | Basic | Integral | int | None" cannot be assigned to parameter "args" of type "Expr | complex" in function "__new__"
-     Type "tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Basic | Integral | Any | int | None" is not assignable to type "Expr | complex"
+     Type "tuple[Unknown, ...] | Unknown | Sum | Expr | Any | Add | Zero | NaN | Piecewise | Basic | Integral | int | None" is not assignable to type "Expr | complex"
-   ...:1894:27 - error: Cannot access attribute "doit" for class "tuple[Unknown, ...]"
-     Attribute "doit" is unknown (reportAttributeAccessIssue)
-     Return type mismatch: base method returns type "Self@Basic", override returns type "Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Integral | Any | Self@Expectation | Literal[0] | None"
+     Return type mismatch: base method returns type "Self@Basic", override returns type "Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Any | Add | Zero | NaN | Piecewise | Integral | Self@Expectation | Literal[0] | None"
-       Type "Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Integral | Any | Expectation* | Literal[0] | None" is not assignable to type "Basic"
+       Type "Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Any | Add | Zero | NaN | Piecewise | Integral | Expectation* | Literal[0] | None" is not assignable to type "Basic"
+   ...:74:9 - error: Method "doit" overrides class "Basic" in an incompatible manner
+     Return type mismatch: base method returns type "Basic", override returns type "Unknown | Any | BernoulliDistribution | Probability | Zero | One | ComplexInfinity | Expr | Float | Infinity | Integer | Lambda | NaN | NegativeInfinity | NegativeOne | Number | Piecewise | Rational | Integral | Literal[0]"
+       Type "Unknown | Any | BernoulliDistribution | Probability | Zero | One | ComplexInfinity | Expr | Float | Infinity | Integer | Lambda | NaN | NegativeInfinity | NegativeOne | Number | Piecewise | Rational | Integral | Literal[0]" is not assignable to type "Basic"
+         "Literal[0]" is not assignable to "Basic" (reportIncompatibleMethodOverride)
-   ...:123:27 - error: Cannot access attribute "doit" for class "tuple[Unknown, ...]"
-     Attribute "doit" is unknown (reportAttributeAccessIssue)
-     Return type mismatch: base method returns type "Basic", override returns type "Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Integral | Any | Literal[0] | None"
+     Return type mismatch: base method returns type "Basic", override returns type "Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Any | Add | Zero | NaN | Piecewise | Integral | Literal[0] | None"
-       Type "Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Integral | Any | Literal[0] | None" is not assignable to type "Basic"
+       Type "Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Any | Add | Zero | NaN | Piecewise | Integral | Literal[0] | None" is not assignable to type "Basic"
-   ...:41:21 - error: Cannot access attribute "simplify" for class "tuple[Unknown, ...]"
-     Attribute "simplify" is unknown (reportAttributeAccessIssue)
-   ...:41:21 - error: "simplify" is not a known attribute of "None" (reportOptionalMemberAccess)
-   ...:366:12 - error: Operator "-" not supported for types "RandomSymbol | Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Integral | Any | ExpectationMatrix | Literal[0] | None" and "RandomSymbol | Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Integral | Any | ExpectationMatrix | Literal[0] | None"
+   ...:366:12 - error: Operator "-" not supported for types "RandomSymbol | Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Any | Add | Zero | NaN | Piecewise | Integral | ExpectationMatrix | Literal[0] | None" and "RandomSymbol | Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Any | Add | Zero | NaN | Piecewise | Integral | ExpectationMatrix | Literal[0] | None"
-   ...:414:21 - error: Argument of type "RandomSymbol | Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Integral | Any | ExpectationMatrix | Literal[0] | None" cannot be assigned to parameter "expr" of type "Basic" in function "simplify"
+   ...:414:21 - error: Argument of type "RandomSymbol | Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Any | Add | Zero | NaN | Piecewise | Integral | ExpectationMatrix | Literal[0] | None" cannot be assigned to parameter "expr" of type "Basic" in function "simplify"
-     Type "RandomSymbol | Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Zero | NaN | Piecewise | Integral | Any | ExpectationMatrix | Literal[0] | None" is not assignable to type "Basic"
+     Type "RandomSymbol | Basic | Expectation | Expr | tuple[Unknown, ...] | Unknown | Sum | Any | Add | Zero | NaN | Piecewise | Integral | ExpectationMatrix | Literal[0] | None" is not assignable to type "Basic"

... (truncated 1861 lines) ...

@erictraut erictraut merged commit 321b6bf into main May 21, 2025
17 checks passed
@erictraut erictraut deleted the dependencies1 branch May 21, 2025 21:37
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.

2 participants