Skip to content

Commit e73ce04

Browse files
mkoeppetkralphs
authored andcommitted
cylp/cy/CyClpSimplex.pyx, cylp/py/mip/GomoryCutGenerator.py: Remove use of Python 2 'long'
1 parent a331df3 commit e73ce04

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cylp/cy/CyClpSimplex.pyx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ cdef class CyClpSimplex:
10221022
10231023
'''
10241024
status = CLP_variableStatusEnum[StatusToInt[status]]
1025-
if isinstance(arg, (int, long)):
1025+
if isinstance(arg, int):
10261026
self.CppSelf.setStatus(arg, status)
10271027
elif True: # isinstance(arg, CyLPVar):
10281028
if self.cyLPModel is None:
@@ -1047,7 +1047,7 @@ cdef class CyClpSimplex:
10471047
'''
10481048
Get the status of a variable.
10491049
'''
1050-
if isinstance(arg, (int, long)):
1050+
if isinstance(arg, int):
10511051
return IntToStatus[self.CppSelf.getStatus(arg)]
10521052
elif True: # isinstance(arg, CyLPVar):
10531053
if self.cyLPModel is None:
@@ -1096,7 +1096,7 @@ cdef class CyClpSimplex:
10961096
'atLowerBound'
10971097
'''
10981098
status = CLP_variableStatusEnum[StatusToInt[status]]
1099-
if isinstance(arg, (int, long)):
1099+
if isinstance(arg, int):
11001100
arg += self.nVariables
11011101
self.CppSelf.setStatus(arg, status)
11021102
elif True: # isinstance(arg, CyLPVar):
@@ -1118,7 +1118,7 @@ cdef class CyClpSimplex:
11181118
'''
11191119
Get the status of a constraint.
11201120
'''
1121-
if isinstance(arg, (int, long)):
1121+
if isinstance(arg, int):
11221122
arg += self.nVariables
11231123
return IntToStatus[self.CppSelf.getStatus(arg)]
11241124
elif True: # isinstance(arg, CyLPVar):
@@ -1718,7 +1718,7 @@ cdef class CyClpSimplex:
17181718
17191719
'''
17201720

1721-
if isinstance(arg, (int, long)):
1721+
if isinstance(arg, int):
17221722
self.CppSelf.setInteger(arg)
17231723
elif True: # isinstance(arg, CyLPVar):
17241724
if self.cyLPModel is None:
@@ -2088,7 +2088,7 @@ cdef class CyClpSimplex:
20882088
arguments may be integers signifying indices, or CyLPVars.
20892089
'''
20902090

2091-
if isinstance(var1, (int, long)) and isinstance(var2, (int, long)) :
2091+
if isinstance(var1, int) and isinstance(var2, int) :
20922092
self.CppSelf.setComplement(var1, var2)
20932093
elif True: # isinstance(arg, CyLPVar):
20942094
if self.cyLPModel is None:

cylp/py/mip/GomoryCutGenerator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def isInt(x):
1212
Return True if x is an integer, or if x is a numpy array
1313
with all integer elements, False otherwise
1414
'''
15-
if isinstance(x, (int, long, float)):
15+
if isinstance(x, (int, float)):
1616
return abs(math.floor(x) - x) < epsilon
1717
return (np.abs(np.floor(x) - x) < epsilon).all()
1818

0 commit comments

Comments
 (0)