2013/12/2 Ryan Gonzalez <rymg19@gmail.com>
Check the _tkinter and _sqlite3 modules.
But they don't do advanced reference management, even if _tkinter/tclobj.py has some calls to Tcl_IncrRefCount() and Tcl_DecrRefCount(). The lxml module has interesting code to manage cross-references between C and Python. I'm afraid it's a bit difficult to read (it's an almost exact port of the cython version) But I found that ffi.new_handle() and ffi.from_handle() are really handy in this case: https://github.com/amauryfa/lxml/blob/cffi/src/lxml-cffi/proxy.py#L20
On Mon, Dec 2, 2013 at 1:29 PM, Dima Tisnek <dimaqq@gmail.com> wrote:
Thanks, Armin, doc page looks good now!
On a related note, I'm thinking to interface jvm/dalvik, similar to jpype (C module) and following pyjnius (cython module), but in cffi.
I'd be very grateful if there was a good pypy/cffi project you could point me to as an example, especially of harder bits like reference management.
d.
On 27 November 2013 18:08, Armin Rigo <arigo@tunes.org> wrote:
Re-Hi,
On Wed, Nov 27, 2013 at 5:24 PM, Armin Rigo <arigo@tunes.org> wrote:
I updated that page.
Armin
pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
-- Ryan When your hammer is C++, everything begins to look like a thumb.
_______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
-- Amaury Forgeot d'Arc