Hi Peter,
On 2018-12-30, Nils Bruin <[email protected]> wrote:
>> Does this only work in interactive mode? As soon as I try to
>> capture it in a function it doesn't work anymore.
The syntax
R.<t> = QQ[[]]
only works interactively. In an interactive session, a preparser is
adding some syntactical sugar:
sage: preparse('R.<t> = QQ[[]]')
"R = QQ[['t']]; (t,) = R._first_ngens(1)"
If you want to write a module for Sage, you have to translate it
into Python syntax. One possibility is to copy the above result of the
preparser. Another possibility is
from sage.rings.power_series_ring import PowerSeriesRing
R = PowerSeriesRing(QQ, 't')
t = R.gen()
Best regards,
Simon
--
You received this message because you are subscribed to the Google Groups
"sage-support" 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 https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.