Skip to content

Commit cb0ad18

Browse files
committed
increasing like constraints args
1 parent 4d759dc commit cb0ad18

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cpmpy/expressions/globalconstraints.py

+6
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,8 @@ class Decreasing(GlobalConstraint):
794794
"""
795795

796796
def __init__(self, *args):
797+
if not is_any_list(args):
798+
raise TypeError("Decreasing expects a list, but got", args)
797799
super().__init__("decreasing", flatlist(args))
798800

799801
def decompose(self):
@@ -816,6 +818,8 @@ class IncreasingStrict(GlobalConstraint):
816818
"""
817819

818820
def __init__(self, *args):
821+
if not is_any_list(args):
822+
raise TypeError("IncreasingStrict expects a list, but got", args)
819823
super().__init__("strictly_increasing", flatlist(args))
820824

821825
def decompose(self):
@@ -838,6 +842,8 @@ class DecreasingStrict(GlobalConstraint):
838842
"""
839843

840844
def __init__(self, *args):
845+
if not is_any_list(args):
846+
raise TypeError("DecreasingStrict expects a list, but got", args)
841847
super().__init__("strictly_decreasing", flatlist(args))
842848

843849
def decompose(self):

0 commit comments

Comments
 (0)