First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 14 years ago

DSM gravatar image

Yeah, that tripped me up too!

You can do it by calling the parent ring, which in this case is the Symbolic Ring, abbreviated SR:

sage: a = 3
sage: type(a)
<type 'sage.rings.integer.Integer'>
sage: parent(a)
Integer Ring
sage: b = SR(a)
sage: type(b)
<type 'sage.symbolic.expression.Expression'>
sage: parent(b)
Symbolic Ring