Skip to content

Commit

Permalink
support vectorized
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimosts committed Sep 9, 2024
1 parent aa43318 commit fd045fd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cpmpy/expressions/python_builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ def abs(element):
if the element given is not a CPMpy expression, the built-in is called
else an Absolute functional global constraint is constructed.
"""
if is_any_list(element):
raise CPMpyException('abs does not accept iterables')
if not isinstance(element, Expression):
if is_any_list(element) or not isinstance(element, Expression):
return builtins.abs(element)

return Abs(element)

0 comments on commit fd045fd

Please sign in to comment.