Hi Martin, On Dec 6, 2007 4:31 PM, chowy <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm trying to use sympy within pypy to compile python code, but > without success. Did you try to do that ? I saw here (http://www.mail- > archive.com/[EMAIL PROTECTED]/msg02801.html), you have succeeded > to use sympy within pypy but did you try to translate python code into > C code, with the translator ? If you have succeeded, is sympy must be > installed as usual (as a module of python) or as a module of pypy ? > > For example, I try to compile this function : > > def test(): > import sympy > n = sympy.Number(3,2) > print n > > > I execute the translator : > python2.4 ../../pypy/bin/translatorshell.py > > >>> t = Translation(test) # -> OK > >>> t.annotate([]) # -> failed > > ... > ... > ... > > ../pypy-1.0.0/pypy/annotation/description.py", line 396, in __init__ > > assert base is object, ("multiple inheritance only supported " > AssertionError: multiple inheritance only supported with _mixin_: > <class 'sympy.core.numbers.Number'> > > > > Can you give me more inforrmations to use sympy with pypy ?
Thanks for trying it out. I sometimes try SymPy in pypy, but the problem with pypy is that it is not yet a correct Python interpeter, so there is perfectly correct python code in SymPy, that fails in pypy, one example is in that link you provided. As to translating to C - if I understand correctly, one has to write in RPython, not Python, in order to get a C code. I tried to use Cython with SymPy and this works though: http://groups.google.com/group/sympy/browse_thread/thread/ad5545eb7fba17d/ So maybe that's the way to go. As to PyPy, I really don't know what to think, because I always thought it's going to be a robust Python interpreter, written in RPython, but after the recent discussion at pypy-dev, the upstream seems kind of undecided. Ondrej --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sympy?hl=en -~----------~----~----~----~------~----~------~--~---
