Skip to content

Commit f687d7f

Browse files
committed
add category and type check to is_isomorphic
1 parent 3da8bad commit f687d7f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/sage/rings/function_field/drinfeld_modules/drinfeld_module.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,9 +1310,15 @@ def is_isomorphic(self, psi):
13101310
sage: psi = DrinfeldModule(A, [Frac(A).gen(), 1, 1])
13111311
sage: phi.is_isomorphic(psi)
13121312
False
1313+
sage: phi.is_isomorphic(A)
1314+
Traceback (most recent call last):
1315+
...
1316+
TypeError: input must be a Drinfeld module
13131317
"""
1318+
if not isinstance(psi, DrinfeldModule):
1319+
raise TypeError("input must be a Drinfeld module")
13141320
# Trivial checks:
1315-
if self.characteristic() != psi.characteristic():
1321+
if self.category() != psi.category():
13161322
return False
13171323
if self._gen == psi._gen:
13181324
return True

0 commit comments

Comments
 (0)