#18192: _sage_getargspec_cython fails to parse -Infinity
-----------------------------+----------------------------
Reporter: jdemeyer | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.6
Component: documentation | Keywords:
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
-----------------------------+----------------------------
{{{
sage: from sage.misc.sageinspect import _sage_getargspec_cython
sage: _sage_getargspec_cython("def foo(x=-Infinity):\n pass")
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
<ipython-input-20-70637b2db91d> in <module>()
----> 1 _sage_getargspec_cython("def foo(x=-Infinity):\n pass")
/usr/local/src/sage-git/local/lib/python2.7/site-
packages/sage/misc/sageinspect.pyc in _sage_getargspec_cython(source)
1121 keywords = '**'+keywords
1122 return _sage_getargspec_from_ast('def
dummy('+''.join(py_units)
-> 1123 +varargs+keywords+'): pass')
1124
1125 def sage_getfile(obj):
/usr/local/src/sage-git/local/lib/python2.7/site-
packages/sage/misc/sageinspect.pyc in _sage_getargspec_from_ast(source)
913 visitor = SageArgSpecVisitor()
914 args = [visitor.visit(a) for a in ast_args.args]
--> 915 defaults = [visitor.visit(d) for d in ast_args.defaults]
916
917 return inspect.ArgSpec(args, ast_args.vararg, ast_args.kwarg,
/usr/local/src/sage-git/local/lib/python/ast.pyc in visit(self, node)
239 method = 'visit_' + node.__class__.__name__
240 visitor = getattr(self, method, self.generic_visit)
--> 241 return visitor(node)
242
243 def generic_visit(self, node):
/usr/local/src/sage-git/local/lib/python2.7/site-
packages/sage/misc/sageinspect.pyc in visit_UnaryOp(self, node)
679 return self.visit(node.operand)
680 if op == 'USub':
--> 681 return -self.visit(node.operand)
682
683 def _grep_first_pair_of_parentheses(s):
TypeError: bad operand type for unary -: 'str'
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/18192>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.