Skip to content

Commit be07520

Browse files
committed
change construction and add doctest
1 parent e417e22 commit be07520

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/sage/schemes/hyperelliptic_curves/constructor.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,13 @@ def is_pAdicField(x):
277277
cls_name.append(name)
278278
break
279279

280+
base_cls = None
281+
if len(superclass) == 0:
282+
base_cls = HyperellipticCurve_generic
283+
280284
class_name = "_".join(cls_name)
281-
cls = dynamic_class(class_name, tuple(superclass),
282-
HyperellipticCurve_generic, doccls=HyperellipticCurve)
285+
cls = dynamic_class(class_name,
286+
tuple(superclass),
287+
cls=base_cls,
288+
doccls=HyperellipticCurve)
283289
return cls(PP, f, h, names=names, genus=g)

src/sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ def jacobian(self):
4545
sage: f = x^5 - x^4 + 3
4646
sage: HyperellipticCurve(f).jacobian()
4747
Jacobian of Hyperelliptic Curve over Rational Field defined by y^2 = x^5 - x^4 + 3
48+
49+
TESTS:
50+
51+
Ensure that :issue:`37612` is fixed::
52+
53+
sage: R.<x> = QQ[]
54+
sage: f = x^5 - x^4 + 3
55+
sage: HyperellipticCurve(f).jacobian
56+
<bound method HyperellipticCurve_g2.jacobian of Hyperelliptic Curve over Rational Field defined by y^2 = x^5 - x^4 + 3>
4857
"""
4958
return jacobian_g2.HyperellipticJacobian_g2(self)
5059

0 commit comments

Comments
 (0)