Opened 9 years ago

Closed 7 years ago

#9393 closed defect (fixed)

symbolic sum cannot handle python ints

Reported by: burcin Owned by: burcin
Priority: major Milestone: sage-5.0
Component: symbolics Keywords:
Cc: whuss, mjo Merged in: sage-5.0.beta1
Authors: Michael Orlitzky Reviewers: Burcin Erocal
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by burcin)

Reported by Tobias Katz on sage-support:

sage: sum(x, x, 1r, 5r)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
.../<ipython console> in <module>()
.../local/lib/python2.6/site-packages/sage/misc/functional.pyc in symbolic_sum(expression, *args, **kwds)
    657     """
    658     if hasattr(expression, 'sum'):
--> 659         return expression.sum(*args, **kwds)
    660     elif len(args) <= 1:
    661         return sum(expression, *args)

.../local/lib/python2.6/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.sum (sage/symbolic/expression.cpp:28895)()

.../local/lib/python2.6/site-packages/sage/calculus/calculus.pyc in symbolic_sum(expression, v, a, b, algorithm)
    482 
    483     if algorithm == 'maxima':
--> 484         sum  = "'sum(%s, %s, %s, %s)" % tuple([repr(expr._maxima_()) for expr in (expression, v, a, b)])
    485         try:
    486             result = maxima.simplify_sum(sum)

AttributeError: 'int' object has no attribute '_maxima_'

Apply attachment:sage-trac_9393.patch

Attachments (1)

sage-trac_9393.patch (763 bytes) - added by mjo 7 years ago.
Add a doctest for the fix.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 9 years ago by whuss

  • Cc whuss added

Changed 7 years ago by mjo

Add a doctest for the fix.

comment:2 Changed 7 years ago by mjo

  • Authors set to Michael Orlitzky
  • Cc mjo added
  • Status changed from new to needs_review

This is fixed, so I've added a doctest for it.

comment:3 Changed 7 years ago by burcin

  • Description modified (diff)
  • Milestone changed from sage-4.8 to sage-5.0
  • Reviewers set to Burcin Erocal
  • Status changed from needs_review to positive_review

Looks good to me.

Thanks for looking into this.

comment:4 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.0.beta1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.