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

Commit

Permalink
improve _element_constructor_
Browse files Browse the repository at this point in the history
  • Loading branch information
behackl committed Sep 29, 2015
1 parent dc00f95 commit abb08ff
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/sage/rings/asymptotic/asymptotic_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,10 +1014,17 @@ def _element_constructor_(self, data, summands=None, simplify=True):
Traceback (most recent call last):
...
TypeError: Cannot convert y to an asymptotic expression.
::
sage: AR(1234, summands=6789)
Traceback (most recent call last):
...
ValueError: Input is ambiguous: 1234 as well as summands=6789 are specified.
"""
if summands is not None:
if type(data) != int or data != 0:
raise ValueError('Input is ambigous: '
raise ValueError('Input is ambiguous: '
'%s as well as summands=%s '
'are specified.' % (data, summands))
return self.element_class(self, summands, simplify=simplify)
Expand Down

0 comments on commit abb08ff

Please sign in to comment.