@@ -1784,8 +1784,9 @@ def _element_constructor_(self, data, *args, **kwds):
1784
1784
1785
1785
TESTS::
1786
1786
1787
- sage: O_ZZ = TermMonoid('O', G_ZZ, QQ)
1788
- sage: O_ZZ(x^11)
1787
+ sage: G = GrowthGroup('x^ZZ')
1788
+ sage: OT = TermMonoid('O', G, ZZ)
1789
+ sage: OT(x^11)
1789
1790
O(x^11)
1790
1791
1791
1792
::
@@ -1809,6 +1810,30 @@ def _element_constructor_(self, data, *args, **kwds):
1809
1810
sage: T_log(log(x))
1810
1811
Term with coefficient 1 and growth log(x)
1811
1812
1813
+ ::
1814
+
1815
+ sage: OT(G.gen(), coefficient=5, growth=G.gen())
1816
+ Traceback (most recent call last):
1817
+ ...
1818
+ ValueError: Argument 'growth=x' is ambiguous.
1819
+ sage: OT(SR(3*x), growth=G.gen())
1820
+ Traceback (most recent call last):
1821
+ ...
1822
+ ValueError: Argument 'growth=x' is ambiguous.
1823
+
1824
+ ::
1825
+
1826
+ sage: OT(G.gen(), 4)
1827
+ doctest:warning
1828
+ ...
1829
+ DeprecationWarning: Passing 'coefficient' as a positional argument is deprecated;
1830
+ specify it as keyword argument 'coefficient=...'.
1831
+ See https://trac.sagemath.org/32215 for details.
1832
+ O(x)
1833
+ sage: OT(G.gen(), 4, coefficient=5)
1834
+ Traceback (most recent call last):
1835
+ ...
1836
+ ValueError: Argument 'coefficient=5' is ambiguous.
1812
1837
"""
1813
1838
if len (args ) > 1 :
1814
1839
raise TypeError (
@@ -1853,8 +1878,7 @@ def _element_constructor_(self, data, *args, **kwds):
1853
1878
1854
1879
if 'growth' in kwds :
1855
1880
raise ValueError (f"Argument 'growth={ kwds ['growth' ]} ' is ambiguous." )
1856
- if 'coefficient' in kwds :
1857
- raise ValueError (f"Argument 'coefficient={ kwds ['coefficient' ]} ' is ambiguous." )
1881
+
1858
1882
return self .from_construction ((None ,
1859
1883
{'growth' : growth ,
1860
1884
'coefficient' : coefficient }),
0 commit comments