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

Commit

Permalink
src/sage/sets/condition_set.py: Remove use of is_CallableSymbolicExpr…
Browse files Browse the repository at this point in the history
…ession
  • Loading branch information
Matthias Koeppe committed Oct 17, 2021
1 parent 8624925 commit 37da733
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/sage/sets/condition_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,9 @@
from sage.misc.cachefunc import cached_method
from sage.misc.misc import _stable_uniq
from sage.structure.element import Expression

try:
from sage.symbolic.callable import is_CallableSymbolicExpression
except ImportError:
is_CallableSymbolicExpression = lambda x: False

from .set import Set, Set_base, Set_boolean_operators, Set_add_sub_operators


class ConditionSet(Set_generic, Set_base, Set_boolean_operators, Set_add_sub_operators,
UniqueRepresentation):
r"""
Expand Down Expand Up @@ -160,7 +155,7 @@ def __classcall_private__(cls, universe, *predicates, vars=None, names=None, cat
other_predicates = []

for predicate in predicates:
if is_CallableSymbolicExpression(predicate):
if isinstance(predicate, Expression) and predicate.is_callable():
if names is None:
names = tuple(str(var) for var in predicate.args())
elif len(names) != len(predicate.args()):
Expand Down Expand Up @@ -271,7 +266,7 @@ def _repr_condition(self, predicate):
sage: ZeroDimButNotNullary._repr_condition(ZeroDimButNotNullary._predicates[0])
't > 0'
"""
if is_CallableSymbolicExpression(predicate):
if isinstance(predicate, Expression) and predicate.is_callable():
args = self.arguments()
if len(args) == 1:
args = args[0]
Expand Down Expand Up @@ -364,7 +359,7 @@ def _call_predicate(self, predicate, element):
sage: Nullary._call_predicate(predicate, element)
t > 0
"""
if is_CallableSymbolicExpression(predicate):
if isinstance(predicate, Expression) and predicate.is_callable():
if len(predicate.arguments()) != 1:
return predicate(*element)
return predicate(element)
Expand Down

0 comments on commit 37da733

Please sign in to comment.