# HG changeset patch
# User Mike Hansen <mhansen@gmail.com>
# Date 1344600243 36000
# Node ID f74a348253451652db0d98c991820fa9d36155a2
# Parent b9e9ed6430f1f29bc733b4ad9421db889f14ce34
#10084: Lazy power series are created with incorrect order
diff git a/sage/combinat/species/series.py b/sage/combinat/species/series.py
a

b


804  804  sage: s = L() 
805  805  sage: s._name = 's' 
806  806  sage: s.define(one+monom*s) 
807   sage: s.aorder 
 807  sage: s.get_aorder() 
808  808  0 
809  809  sage: s.order 
810  810  Unknown series order 
… 
… 

818  818  sage: s = L() 
819  819  sage: s._name = 's' 
820  820  sage: s.define(one+monom*s*s) 
821   sage: s.aorder 
 821  sage: s.get_aorder() 
822  822  0 
823  823  sage: s.order 
824  824  Unknown series order 
… 
… 

832  832  sage: s = L() 
833  833  sage: s._name = 's' 
834  834  sage: s.define(monom + s*s) 
835   sage: s.aorder 
 835  sage: s.get_aorder() 
836  836  1 
837  837  sage: s.order 
838  838  Unknown series order 
… 
… 

977  977  self._reference._copy(self) 
978  978  
979  979  def _new(self, compute_coefficients, order_op, *series, **kwds): 
 980  """ 
 981  TESTS: 
 982  
 983  We check that :trac:`10084` is indeed fixed:: 
 984  
 985  sage: S = LazyPowerSeriesRing(ZZ) 
 986  sage: one = S(0) + S(1) 
 987  sage: one.coefficients(3) 
 988  [1, 0, 0] 
 989  
 990  sage: from sage.combinat.species.stream import Stream 
 991  sage: zero = S(0) 
 992  sage: test_series = zero._new(lambda ao: Stream(const=1), lambda: 0) 
 993  sage: test_series.coefficients(3) 
 994  [1, 1, 1] 
 995  """ 
980  996  parent = kwds['parent'] if 'parent' in kwds else self.parent() 
981   new_fps = self.__class__(parent, stream=None, order=unk, aorder=self.aorder, 
 997  new_fps = self.__class__(parent, stream=None, order=unk, aorder=unk, 
982  998  aorder_changed=True, is_initialized=False) 
983  999  
984  1000  new_fps.compute_aorder = lambda: new_fps._approximate_order(compute_coefficients, order_op, *series) 
… 
… 

1183  1199  sage: s = L([1]) 
1184  1200  sage: t = L([0,0,1,0]) 
1185  1201  sage: u = s(t) 
1186   sage: u.aorder 
 1202  sage: u.get_aorder() 
1187  1203  0 
1188  1204  sage: u.order 
1189  1205  Unknown series order 
… 
… 

1483  1499  [1, 0, 4, 5, 6] 
1484  1500  """ 
1485  1501  yield integration_constant 
1486   ao = self.aorder 
 1502  ao = self.get_aorder() 
1487  1503  assert ao != unk 
1488  1504  
1489  1505  if ao == inf: 