Repository navigation
Conversation
Expr.__pow__ and GenExpr.__pow__ declared a third parameter modulo that the method bodies never used, so pow(x, y, mod) silently ignored the modulus and returned an Expr. Drop the parameter from both Cython definitions and sync the four affected mod: Incomplete = ... stubs in scip.pyi. pow(x, y, mod) now raises TypeError, matching the Python convention that three-arg pow is only meaningful for integers.
Zeroto521
marked this pull request as ready for review
October 12, 2026 13:44
Contributor
Author
|
Cython maps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expr.__pow__andGenExpr.__pow__insrc/pyscipopt/expr.pxiboth declared a third parameter namedmodulo, but neither method body ever reads it. The effect:pow(x, 2, 5)silently ignores the modulus and returns the un-reduced expression, while Python's ownpowconvention is that a three-argument call is only meaningful for integers and should raiseTypeErrorwhen the base does not support it.Removing the parameter makes the behavior match the convention:
x ** 2andpow(x, 2)are unchanged.