Opened 13 years ago

Closed 13 years ago

#4171 closed defect (duplicate)

SR + long broken

Reported by: was Owned by: somebody
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: basic arithmetic Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Adding a long to a symbolic variable is broken:

sage: x + int(5) 
x + 5

Not OK:
sage: x + long(5)
TypeError                                 Traceback (most recent call last)

/home/wstein/<ipython console> in <module>()

/home/wstein/element.pyx in sage.structure.element.ModuleElement.__add__ (sage/structure/element.c:5748)()

/home/wstein/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:6364)()

TypeError: unsupported operand parent(s) for '+': 'Symbolic Ring' and '<type 'long'>'

Change History (2)

comment:1 Changed 13 years ago by jason

Related (and maybe the root of the problem):

sage: SR(long(2))     
TypeError                                 Traceback (most recent call last)

/home/grout/sage/devel/sage-main/sage/plot/<ipython console> in <module>()

/home/grout/downloads/sage-3.1.2/local/lib/python2.5/site-packages/sage/calculus/ in __call__(self, x)

/home/grout/downloads/sage-3.1.2/local/lib/python2.5/site-packages/sage/calculus/ in _coerce_impl(self, x)

TypeError: cannot coerce type '<type 'long'>' into a SymbolicExpression.

comment:2 Changed 13 years ago by mabshoff

  • Milestone changed from sage-3.1.3 to sage-duplicate/invalid
  • Resolution set to duplicate
  • Status changed from new to closed

This is a dupe if #4170 which robertwb opened. Since that ticket has a patch I am closing this one as a dupe.



Note: See TracTickets for help on using tickets.