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

Commit c4a0e22

Browse files
committed
merge accepting and rejecting functors in all cases
1 parent aeae8f3 commit c4a0e22

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/sage/symbolic/subring.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,7 @@ def merge(self, other):
758758
elif type(self) == type(other):
759759
return type(self)(self.vars & other.vars)
760760
elif isinstance(other, SymbolicSubringRejectingVarsFunctor):
761-
if not (self.vars & other.vars):
762-
return self
761+
return type(self)(self.vars - other.vars)
763762

764763

765764
def _apply_functor(self, R):
@@ -965,8 +964,7 @@ def merge(self, other):
965964
elif type(self) == type(other):
966965
return type(self)(self.vars | other.vars)
967966
elif isinstance(other, SymbolicSubringAcceptingVarsFunctor):
968-
if not (self.vars & other.vars):
969-
return other
967+
return type(other)(other.vars - self.vars)
970968

971969

972970
def _apply_functor(self, R):

0 commit comments

Comments
 (0)