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

Commit

Permalink
Trac 17543: reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pjbruin committed Apr 27, 2015
1 parent 7f8a5de commit 256df27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
18 changes: 2 additions & 16 deletions src/sage/modular/abvar/finite_subgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ def _element_constructor_(self, x, check=True):
sage: G(J.torsion_subgroup(3).0)
Traceback (most recent call last):
...
TypeError: x does not define an element of self
TypeError: cannot convert (1/3, 0, 0, 0) into Finite subgroup with invariants [11, 11, 11, 11] over QQ of Abelian variety J0(23) of dimension 2
"""
if isinstance(x, TorsionPoint):
if x.parent() == self:
Expand All @@ -651,7 +651,7 @@ def _element_constructor_(self, x, check=True):
z = self.abelian_variety().vector_space()(x, check=check)
if z in self.lattice():
return self.element_class(self, z, check=False)
raise TypeError("x does not define an element of self")
raise TypeError("cannot convert {!r} into {}".format(x, self))


def __contains__(self, x):
Expand Down Expand Up @@ -787,20 +787,6 @@ def invariants(self):
self.__invariants = I
return I

def generator_orders(self):
"""
Return the orders of the chosen generators of ``self``.
EXAMPLES::
sage: G = J0(24).cuspidal_subgroup()
sage: G.gens()
[[(1/4, 0)], [(0, 1/2)]]
sage: G.generator_orders()
[4, 2]
"""
return [x.additive_order() for x in self.gens()]

__iter__ = abelian_iterator


Expand Down
2 changes: 1 addition & 1 deletion src/sage/structure/gens_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def abelian_iterator(M):
yield M(0)
return

stop = list(M.generator_orders())
stop = [g.additive_order() for g in G]
for i in range(len(stop)):
if stop[i] is infinity:
raise ArithmeticError("%s is not finite."%M)
Expand Down

0 comments on commit 256df27

Please sign in to comment.