I imagine the preparser could be made more robust with sage: preparse("32") 'sage.rings.integer.Integer(32)'
On Sat, 19 Aug 2023 at 02:08, Nils Bruin <nbr...@sfu.ca> wrote: > > Perhaps superfluously: the reason why redefining `Integer` (in your example > through "from sympy import *") can break a command in sage that does not seem > to involve `Integer`: > > sage: preparse("K = CyclotomicField(32)") > 'K = CyclotomicField(Integer(32))' > > Due to Sage's preparser, any use of integer constants involves `Integer`. > Even calling `int` on them: > > sage: preparse("int(32)") > 'int(Integer(32))' > > there is a special postfix you can use to really get a python int, without > involvement of `Integer`: > > sage: preparse("32r") > '32' > > -- > 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 sage-support+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-support/d2e07668-8b64-4f07-853d-1a41d9a458fen%40googlegroups.com. -- 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 sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CAGEwAA%3Dspk2tUCrzraVO55hGPgB566Q-YDkm4%3D6vnp-qJpsTrA%40mail.gmail.com.