On Thu, May 12, 2011 at 19:40, Aaron Meurer <asmeu...@gmail.com> wrote:
> On Thu, May 12, 2011 at 5:50 PM, Ronan Lamy <ronan.l...@gmail.com> wrote:
>> Le jeudi 12 mai 2011 à 16:41 -0600, Aaron Meurer a écrit :
>>> Would it require the ast module?  That is only available on 2.6+.  But
>>> that's better than nothing.  1/2 vs. S(1)/2 is by far the number one
>>> gotcha that I see.
>>
>> That's really the only thing that prevents us from using a standard
>> Python shell. I wish Python did the right thing and returned
>> fractions.Fraction(1, 2) for 1/2... Since that's not the case, the next
>> easiest option is to wrap all integer literals with Integer() - which
>> shouldn't be hard in ipython, I hope.
>>
>
> Oh, yeah, that would do it.  We should be able to do that with a
> simple regex replacement, no advanced parsing like ast needed.
>
> We could also wrap float literals with Real(" "), so that you
> automatically get lossless arbitrary precision floats.
>
> Actually, now that I think about it, it isn't so simple as regex,
> because you don't want to do it with literals that are in strings.  So
> probably the best way is to use an actual parser.

You could use the tokenize module. I'm not sure if that's available on
the App Engine, but it probably is.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to