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

Commit

Permalink
17531: add check for any other than 'ginac' algorithm keywords in Gin…
Browse files Browse the repository at this point in the history
…acFunction
  • Loading branch information
rwst committed Feb 5, 2015
1 parent 4bac623 commit d8f09d0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/sage/symbolic/function.pyx
Expand Up @@ -841,9 +841,22 @@ cdef class GinacFunction(BuiltinFunction):
sage: out = arctan2(int(0), RR(1))
sage: (out, parent(out))
(0, Integer Ring)
TESTS::
sage: sin(x, algorithm='foo')
Traceback (most recent call last):
...
ValueError: unknown algorithm 'foo' for sin
sage: sin(x, algorithm='ginac')
sin(x)
"""
res = super(GinacFunction, self).__call__(*args, **kwds)

algorithm = kwds.get('algorithm')
if algorithm is not None and algorithm != "ginac":
raise ValueError("unknown algorithm %r for %s"%(algorithm,self))

# Convert to Integer if the output was of type "int" and any of
# the inputs was a Sage Element
if isinstance(res, int) and any(isinstance(x, Element) for x in args):
Expand Down

0 comments on commit d8f09d0

Please sign in to comment.