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

Commit

Permalink
ConditionSet: Do not sort the conditions, just use _stable_uniq
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Jul 8, 2021
1 parent 82f12e2 commit 0f60232
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sage/sets/condition_set.py
Expand Up @@ -17,6 +17,7 @@
from sage.structure.unique_representation import UniqueRepresentation
from sage.categories.sets_cat import Sets
from sage.misc.cachefunc import cached_method
from sage.misc.misc import _stable_uniq
from sage.symbolic.expression import is_Expression
from sage.symbolic.callable import is_CallableSymbolicExpression
from sage.symbolic.ring import SymbolicRing, SR, is_SymbolicVariable
Expand Down Expand Up @@ -155,7 +156,7 @@ def __classcall_private__(cls, universe, *predicates, vars=None, names=None, cat
else:
other_predicates.append(predicate)

predicates = sorted(set(callable_symbolic_predicates)) + other_predicates
predicates = list(_stable_uniq(callable_symbolic_predicates + other_predicates))

if not other_predicates and not callable_symbolic_predicates:
if names is None and category is None:
Expand Down Expand Up @@ -400,7 +401,7 @@ def _sympy_(self):
False
sage: Interval = ConditionSet(RR, x >= -7, x <= 4, vars=[x]); Interval
{ x ∈ Real Field with 53 bits of precision : x <= 4, x >= -7 }
{ x ∈ Real Field with 53 bits of precision : x >= -7, x <= 4 }
sage: Interval._sympy_()
ConditionSet(x, (x >= -7) & (x <= 4), SageSet(Real Field with 53 bits of precision))
Expand Down

0 comments on commit 0f60232

Please sign in to comment.