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

Commit

Permalink
error with the element constructor fixed, doctest added
Browse files Browse the repository at this point in the history
  • Loading branch information
behackl committed Aug 14, 2015
1 parent 3749fa1 commit c6d8584
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/sage/groups/asymptotic_growth_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,11 +757,25 @@ def _element_constructor_(self, data, raw_element=None):
Traceback (most recent call last):
...
ValueError: Input is ambigous: x as well as raw_element=42 are specified
::
sage: x = agg.GrowthGroup('x^ZZ')(raw_element=1)
sage: G_y = agg.GrowthGroup('y^ZZ')
sage: G_y(x)
Traceback (most recent call last):
...
ValueError: Cannot convert x.
"""
if raw_element is None:
if type(data) == self.element_class and data.parent() == self:
return data
elif isinstance(data, GenericGrowthElement):
try:
if self._var_ != data.parent()._var_:
raise ValueError('Cannot convert %s.' % (data,))
except AttributeError:
pass
raw_element = data._raw_element_
elif type(data) == int and data == 0:
raise ValueError('No input specified. Cannot continue.')
Expand Down

0 comments on commit c6d8584

Please sign in to comment.