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

Commit

Permalink
Some temporary hacks to make absolute_field() work
Browse files Browse the repository at this point in the history
this should probably go into #26105
  • Loading branch information
saraedum committed Aug 29, 2018
1 parent cb8418a commit 8685729
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sage/rings/finite_rings/homset.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __call__(self, im_gens, check=True):
sage: H == loads(dumps(H))
True
"""
if isinstance(im_gens, FiniteFieldHomomorphism_generic):
if isinstance(im_gens, Map):
return self._coerce_impl(im_gens)
try:
if self.domain().degree() == 1:
Expand Down Expand Up @@ -118,13 +118,13 @@ def _coerce_impl(self, x):
To: Finite Field in b of size 5^4
Defn: a |--> 4*b^3 + 4*b^2 + 4*b + 3
"""
if not isinstance(x, FiniteFieldHomomorphism_generic):
raise TypeError
if x.parent() is self:
return x
if not isinstance(x, FiniteFieldHomomorphism_generic):
raise TypeError # TODO: Should be NotImplementedError
if x.parent() == self:
return FiniteFieldHomomorphism_generic(self, x.im_gens())
raise TypeError
raise TypeError # TODO: Should be NotImplementedError

def _repr_(self):
"""
Expand Down

0 comments on commit 8685729

Please sign in to comment.