Ask Your Question

Revision history [back]

You can use the sage_input function, which, luckilly selects the thort name among possible constructions:

sage: a = RationalField()
sage: sage_input(a)
QQ

It seems however not to work with RLF:

sage: for obj in [QQ, RDF, AA, RR, ZZ, QQbar, RLF]:
....:     print sage_input(obj)
QQ
RDF
AA
RR
ZZ
QQbar
ValueError: Can't convert Real Lazy Field to sage_input form

You can use the sage_input function, which, luckilly luckily selects the thort short name among the possible constructions:

sage: a = RationalField()
sage: sage_input(a)
QQ

It seems however not to work with RLF:

sage: for obj in [QQ, RDF, AA, RR, ZZ, QQbar, RLF]:
....:     print sage_input(obj)
QQ
RDF
AA
RR
ZZ
QQbar
ValueError: Can't convert Real Lazy Field to sage_input form