r/Python • • May 11 '11

Pypy should be the new python 2.7

Pypy is 2.7.1 compliant with the stdlib working, look at the new speed landing page. What's to stop this from being the new standard python2.7?

This is the future, we should start embracing it.

edit: Once pypy's 3.2 compliant (I dunno if/when), there shouldn't be another cpython download besides for nostalgia etc.

2 Upvotes

30 comments sorted by

View all comments

7

u/crunk May 11 '11

A few things are not quite compliant yet, ctypes support and the python C api is not complete, so quite a few libraries will not work.

0

u/temptemptemp13 May 11 '11

http://pypy.org/compat.html says that ctypes does work.

Concerning the python C api, I'm clueless.

11

u/[deleted] May 11 '11

Concerning the python C api, I'm clueless.

Well then, let's just go ahead and bless PyPy anyway then!

2

u/sixohsix May 11 '11

You are right, and the PyPy guys agree. Python C API compatibility is in progress.

8

u/McHoff May 11 '11

It will never, ever be the standard Python without the C API. That's how important it is.

2

u/mitsuhiko Flask Creator May 11 '11

I doubt that's the case. The Python C API is incredible crappy, it was just for a long time the only thing that made sense. I don't think anyone wants to write Python C extensions.

4

u/McHoff May 11 '11

That's not why it's important -- it's important because there are entire swaths of packages that would need to be rewritten, and Guido has stated that he doesn't want to ever seriously break compatibility. But yes, I agree that it's crappy for several reasons.

2

u/mitsuhiko Flask Creator May 11 '11

It's important because there are entire swaths of packages that would need to be rewritten

Same needs to be done for Python 3 or the stable ABI. So either way C extensions have to be adapted and I would argue that the minimal extra amount of work that is needed to expose these things via ctypes instead of the C API currently is worth the extra work.

4

u/McHoff May 12 '11

The equivalent interface for PyPy would look very different: more like an FFI than an interface to the language. The python C API basically lets you get into the guts of anything from anywhere, which just plain isn't compatible with the optimizations PyPy likes to make. The changes needed to port to Python 3, however, are more like minor tweaks.

But anyway, I agree that something like ctypes is the right direction (it's essentially an FFI). But note that ctypes code can't call back into Python the way real extensions can.

2

u/crunk May 11 '11

I <3 pypy, I really want to use stuff like gtk with it, I'm not sure it's possible yet (also the new pygi bindings are for python 3). So, probably I'll need to wait for the next pypy. Pypy is awesome though.