Skip to content

Commit b698d12

Browse files
committed
raise error if categories differ
1 parent d392647 commit b698d12

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,9 @@ def is_isomorphic(self, psi):
13091309
sage: phi = DrinfeldModule(A, [a, 1, 1])
13101310
sage: psi = DrinfeldModule(A, [Frac(A).gen(), 1, 1])
13111311
sage: phi.is_isomorphic(psi)
1312-
False
1312+
Traceback (most recent call last):
1313+
...
1314+
ValueError: categories of the two Drinfeld modules must be the same
13131315
sage: phi.is_isomorphic(A)
13141316
Traceback (most recent call last):
13151317
...
@@ -1319,7 +1321,8 @@ def is_isomorphic(self, psi):
13191321
raise TypeError("input must be a Drinfeld module")
13201322
# Trivial checks:
13211323
if self.category() != psi.category():
1322-
return False
1324+
raise ValueError("categories of the two Drinfeld modules "
1325+
"must be the same")
13231326
if self._gen == psi._gen:
13241327
return True
13251328
if self._gen.degree() != psi._gen.degree():

0 commit comments

Comments
 (0)