
Oops, replied in private by mistake... ----- Forwarded message from tinuviel ----- To: Ben Young <ben@transversal.com> Subject: Re: [pypy-dev] Patches? On Wed, Jun 30, 2004 at 11:08:38AM +0100, Ben Young wrote:
Hi,
I have been following the pypy-dev mailing list for some time, as well as maintaining a anon svn checkout of the pypy source and am really excited by this project (in fact it has inspired me to write my own experimental language in python along similar lines!).
Welcome to PyPy!
I was just wondering whether the project is considered stable enough to accept patches and/or bug reports from people who are not directly developers (i.e me!). I have been playing with getting pypy to run some of my own python programs, and although it seems to get pretty close there are a couple of issues.
PyPy is not exactly stable, but I think patches are welcome any time.
The first is in appspace/operator.py where if you import this in the trivial object space then is gives errors about modifying a dictionary while iterating over it. This can be fixed by the following patch (patch follows)
Fixed in r5407, but in a different way. In case you don't read the commit mailing list, here is the detail: http://codespeak.net/pipermail/pypy-svn/2004-June/002572.html In short, "#ugh" part is removed altogether. It was a hack, and it was there to make built-in function never-bound as in CPython. (See the checkin message.) If you don't understand what that means, try this: ==== from operator import add def add2(x,y): return x+y class X: pass X.add = add X.add2 = add2 print X().add(2,2) print X().add2(2,2) ==== CPython doesn't raise exception for X().add, but do for X().add2. That's because built-in function operator.add is never-bound. PyPy before commit does the same. PyPy after commit raise exception for both.
The second is in pprint. If you do
import pprint pprint.pprint([])
you get a massive traceback which I haven't yet quite worked out a fix for.
This seems to work in the standard object space though. Regards, ----- End forwarded message -----

Hello, Ben, welcome to PyPy! Yes, patches are welcome and encouraged. At this point I guess that people interested to contribute can get check-in right easily too.
The second is in pprint. If you do
import pprint pprint.pprint([])
you get a massive traceback which I haven't yet quite worked out a fix for.
This seems to work in the standard object space though.
It was a limitation of the trivial object space not accepting keyword arguments in one of its dark internal relaying routines. Fixed. TrivialObjSpace is really not trivial at all. I believe that ideally it should be (1) renamed, (2) no longer the default. Always run 'py.py -S' unless you have a reason not to. Armin

On Thursday 01 July 2004 16:39, Armin Rigo wrote:
Hello,
TrivialObjSpace is really not trivial at all. I believe that ideally it should be (1) renamed, (2) no longer the default. Always run 'py.py -S' unless you have a reason not to.
I that case you will be happy to know that from this morning pypy runs my small test language with no problems. If pypy does end up faster than C I can see languages written in Python being themselves faster than Python itself! :) Keep up the good work! Ben ---
participants (3)
-
Armin Rigo
-
Ben Young
-
Seo Sanghyeon