From f6e21137f97771b916ceae7f16a59805af78291f Mon Sep 17 00:00:00 2001 From: Ralf Stephan Date: Thu, 5 Mar 2015 16:05:00 +0100 Subject: [PATCH] 17790: add padics to the conversion workaround for symbolic function arguments --- src/sage/symbolic/function.pyx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx index e4de715dea5..c22e333650f 100644 --- a/src/sage/symbolic/function.pyx +++ b/src/sage/symbolic/function.pyx @@ -389,6 +389,8 @@ cdef class Function(SageObject): TypeError: cannot coerce arguments: ... sage: exp(QQbar(I)) 0.540302305868140 + 0.841470984807897*I + sage: binomial(Qp(2)(9),5) + 126 For functions with single argument, if coercion fails we try to call a method with the name of the function on the object:: @@ -474,12 +476,14 @@ cdef class Function(SageObject): # to work around this limitation, we manually convert # elements of QQbar to symbolic expressions here from sage.rings.qqbar import QQbar, AA + from sage.rings.padics.padic_generic_element import pAdicGenericElement nargs = [None]*len(args) for i in range(len(args)): carg = args[i] - if isinstance(carg, Element) and \ - (carg)._parent is QQbar or \ - (carg)._parent is AA: + if (isinstance(carg, Element) and + ((carg)._parent is QQbar or + (carg)._parent is AA or + isinstance(carg, pAdicGenericElement))): nargs[i] = SR(carg) else: try: