-
-
Notifications
You must be signed in to change notification settings - Fork 657
Closed
Milestone
Description
In SAGE 2.6, you can do list * integer but not integer * list. Either they should both work (more like python) or neither of them should work (for internal consistency).
sage: [3, 4, 5] * 2
[3, 4, 5, 3, 4, 5]
sage: 2 * [3, 4, 5]
---------------------------------------------------------------------------
<type 'exceptions.TypeError'> Traceback (most recent call last)
/home/dmharvey/sage-2.6/<ipython console> in <module>()
/home/dmharvey/sage-2.6/element.pyx in element.RingElement.__mul__()
/home/dmharvey/sage-2.6/element.pyx in element.bin_op_c()
<type 'exceptions.TypeError'>: unsupported operand parent(s) for '*': 'Integer Ring' and '<type 'list'>'
Component: basic arithmetic
Issue created by migration from https://trac.sagemath.org/ticket/401