Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
17790: add padics to the conversion workaround for symbolic function …
Browse files Browse the repository at this point in the history
…arguments
  • Loading branch information
rwst committed Mar 5, 2015
1 parent b22c33b commit f6e2113
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/sage/symbolic/function.pyx
Expand Up @@ -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::
Expand Down Expand Up @@ -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 \
(<Element>carg)._parent is QQbar or \
(<Element>carg)._parent is AA:
if (isinstance(carg, Element) and
((<Element>carg)._parent is QQbar or
(<Element>carg)._parent is AA or
isinstance(carg, pAdicGenericElement))):
nargs[i] = SR(carg)
else:
try:
Expand Down

0 comments on commit f6e2113

Please sign in to comment.