Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
GenericBackend.remove_constraints: Fix handling of int
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Jan 4, 2023
1 parent 953198e commit 89e5778
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sage/numerical/backends/generic_backend.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,9 @@ cdef class GenericBackend:
sage: p.add_linear_constraint([(0, 3), (1, 2)], None, 6) # optional - Nonexistent_LP_solver
sage: p.remove_constraints([0, 1]) # optional - Nonexistent_LP_solver
"""
if type(constraints) == int: self.remove_constraint(constraints)
if isinstance(constraints, int):
self.remove_constraint(constraints)
return

cdef int last = self.nrows() + 1

Expand Down

0 comments on commit 89e5778

Please sign in to comment.