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

Commit

Permalink
extend _coerce_map_from_ in rejecting-subring
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Sep 20, 2015
1 parent 4b8f9be commit 8696a6e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/sage/symbolic/subring.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,9 +797,16 @@ def _coerce_map_from_(self, P):
False
sage: R.has_coerce_map_from(RS) # indirect doctest
True
sage: A = SymbolicSubring(accepting_variables=('a',))
sage: R.has_coerce_map_from(A)
True
sage: A.has_coerce_map_from(R)
False
"""
if isinstance(P, SymbolicSubringRejectingVars):
return self._vars_ <= P._vars_
elif isinstance(P, SymbolicSubringAcceptingVars):
return not (self._vars_ & P._vars_)
return super(SymbolicSubringRejectingVars, self)._coerce_map_from_(P)


Expand Down

0 comments on commit 8696a6e

Please sign in to comment.