Changes between Initial Version and Version 6 of Ticket #9989


Ignore:
Timestamp:
03/23/11 11:18:44 (10 years ago)
Author:
burcin
Comment:

Replying to robertwb:

The error "TypeError?: cannot index numeric, constant or symbol" is rather obscure, better to make it something like "... has no operands."

Done. The new message is: "expressions containing only a numeric coefficient, constant or symbol have no operands"

Any reason why expr.op isn't just a plain list?

I wanted to avoid traversing the vector storing the operands and creating a python object for each. A list wouldn't allow nested indexing either:

sage: x,y,z = var('x,y,z')
sage: e = x + x*y + z^y + 3*y*z; e
x*y + 3*y*z + z^y + x
sage: e.op[1]
3*y*z
sage: e.op[1,1]
z

This syntax was proposed in a discussion at Sage days 24 last summer.

Apply trac_9989-operands.take2.patch

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9989

    • Property Status changed from new to needs_review
    • Property Cc jpflori added
    • Property Reviewers changed from to Robert Bradshaw
  • Ticket #9989 – Description

    initial v6  
    1616
    1717Using `__getitem__()` directly was not an option since it breaks conversion to numpy.
     18
     19
     20Apply trac_9989-operands.take2.patch