Hi all,

Starting from last night, the nightly builds of PyPy are able to run
this kind of code:

http://bpaste.net/show/155166/

(You have to adjust the libpython2.x.so path manually.)

The idea is to link in the libpython.so, using cffi.  Then you can use
it much like you would in C.  For example, you can import complete
CPython packages and call them.  This is similar to the earlier
experiments done by fijal about calling matplotlib via CPython, except
this time done with cffi.

The code above supports __add__(), which lets you just write "x3 = x1
+ x2" for any two PyObject instances x1 and x2.  It's unclear if it's
a good idea, but it's at least a cool hack.  To be really useful, it
needs much more work, of course, starting with a clearer design of
what the goal really would be :-)


A bientôt,

Armin.
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to