# HG changeset patch
# User Chris Wuthrich <christian.wuthrich@gmail.com>
# Date 1299787936 0
# Node ID 73ef0c9e7f6e3e7d142c23c801b77df92a849b1b
# Parent 43717942fe51d6aaa4b0921554bc1bfff383485a
trac 10888: evaluation of multi_polynomials gives back elements in the base ring.
diff r 43717942fe51 r 73ef0c9e7f6e sage/rings/polynomial/multi_polynomial_libsingular.pyx
a

b


1741  1741  sage: f(5,3,10) 
1742  1742  4580 
1743  1743  
1744   See #8502:: 
 1744  See #8502 and #10888:: 
1745  1745  
1746  1746  sage: x = polygen(QQ) 
1747  1747  sage: K.<t> = NumberField(x^2+47) 
… 
… 

1758  1758  9 
1759  1759  sage: a.parent() is QQ 
1760  1760  True 
 1761  sage: a = f(X=2,Y=3,Z=4);a 
 1762  9 
 1763  sage: a.parent() is QQ 
 1764  True 
1761  1765  
1762  1766  """ 
 1767  cdef MPolynomialRing_libsingular parent = (<MPolynomialRing_libsingular>self._parent) 
 1768  
 1769  
1763  1770  if len(kwds) > 0: 
1764  1771  f = self.subs(**kwds) 
1765  1772  if len(x) > 0: 
1766  1773  return f(*x) 
1767  1774  else: 
1768   return f 
1769   
 1775  
 1776  if f == 0: 
 1777  return parent._base._zero_element 
 1778  if f in parent.base_ring(): 
 1779  return parent.base_ring()(f) 
 1780  
 1781  
1770  1782  cdef int l = len(x) 
1771   cdef MPolynomialRing_libsingular parent = (<MPolynomialRing_libsingular>self._parent) 
1772  1783  cdef ring *_ring = parent._ring 
1773  1784  
1774  1785  if l == 1 and (PY_TYPE_CHECK(x[0], tuple) or PY_TYPE_CHECK(x[0], list)): 