#14780: allow embedding python tuples in SR
---------------------------------+------------------------------------------
Reporter: burcin | Owner: burcin
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.11
Component: symbolics | Resolution:
Keywords: sd48 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Burcin Erocal | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Changes (by {'newvalue': u'Burcin Erocal', 'oldvalue': ''}):
* keywords: => sd48
* status: new => needs_review
* author: => Burcin Erocal
Old description:
> Attached patch allows embedding Python tuples in symbolic expressions:
>
> {{{
> sage: t = SR._force_tuple((1, 2, x, x+1, x+2))
> sage: t
> (1, 2, x, x + 1, x + 2)
> sage: t.subs(x = 2*x^2)
> (1, 2, 2*x^2, 2*x^2 + 1, 2*x^2 + 2)
> sage: t.op[0]
> 1
> sage: t.op[2]
> x
> }}}
New description:
Attached patch allows embedding Python tuples in symbolic expressions:
{{{
sage: t = SR._force_tuple((1, 2, x, x+1, x+2))
sage: t
(1, 2, x, x + 1, x + 2)
sage: t.subs(x = 2*x^2)
(1, 2, 2*x^2, 2*x^2 + 1, 2*x^2 + 2)
sage: t.op[0]
1
sage: t.op[2]
x
}}}
Apply: [attachment:trac_14780-embed_tuples_in_SR.patch]
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14780#comment:1>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.