[pypy-issue] [issue1233] str() types can't be used with ctypes's py_object()

Armin Rigo tracker at bugs.pypy.org
Mon Sep 3 12:02:32 CEST 2012


Armin Rigo <armin.rigo at gmail.com> added the comment:

Passing a "payload" argument for a callback is needed if you were writing all C
code, but not if you are writing the callback in Python.  Can't you use the
following scheme instead?

def make_callback(payload_string):
    def callback(args..):
        ... use payload_string ...
    return callback

Then you pass to C code the callback from "make_callback(string)".  The c_void_p
argument is not useful and can always be NULL.

----------
nosy: +arigo

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1233>
________________________________________


More information about the pypy-issue mailing list