#9989: easier access to operands of a symbolic expression
-----------------------------+----------------------------------------------
Reporter: burcin | Owner: burcin
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.6
Component: symbolics | Keywords:
Author: Burcin Erocal | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Attached patch adds an `op` attribute to symbolic expressions which gives
easy access to its operands. We now have:
{{{
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
sage: e.op[-1]
x
sage: e.op[1:]
[3*y*z, z^y, x]
}}}
Using `__getitem__()` directly was not an option since it breaks
conversion to numpy.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9989>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.