# HG changeset patch
# User darij grinberg <darijgrinberg@gmail.com>
# Date 1376831063 25200
# Node ID 165522834ae0be89e424863d1651b8dc6671d397
# Parent 27fcda614e77e0596f62de4430270c34b2a0356e
trac #15059: modifying __call__ on elements of multivariate power series rings to avoid calling add_bigoh on elements of the base ring
diff git a/sage/rings/multi_power_series_ring_element.py b/sage/rings/multi_power_series_ring_element.py
a

b

class MPowerSeries(PowerSeries): 
437  437  
438  438  sage: f.truncate()(t,2) 
439  439  2*t + 3*t^2 + 7*t^3 + 3*t^4 
 440  
 441  Checking that :trac:`15059` is fixed:: 
 442  
 443  sage: M.<u,v> = PowerSeriesRing(GF(5)) 
 444  sage: s = M.hom([u, u+v]) 
 445  sage: s(M.one()) 
 446  1 
440  447  """ 
441  448  if len(x) != self.parent().ngens(): 
442  449  raise ValueError("Number of arguments does not match number of variables in parent.") 
443  450  
444  451  sub_dict = {} 
445   valn_list =[] 
 452  valn_list = [] 
446  453  for i in range(len(x)): 
447  454  try: 
448  455  xi = self.parent(x[i]) 
… 
… 
class MPowerSeries(PowerSeries): 
461  468  newprec = infinity 
462  469  else: 
463  470  newprec = self.prec()*min(valn_list) 
464   return self._value().subs(sub_dict).add_bigoh(newprec) 
 471  return self.parent()(self._value().subs(sub_dict)).add_bigoh(newprec) 
465  472  
466  473  def _subs_formal(self, *x, **kwds): 
467  474  """ 