Ah, ctypes

David Bolen db3l.net at gmail.com
Mon Jun 1 20:51:04 CEST 2009

Nick Craig-Wood <nick at craig-wood.com> writes:

> ctypes could potentially note that function types don't have enough
> references to them when passed in as arguments to C functions?  It
> might slow it down microscopically but it would fix this problem.

Except that ctypes can't know the lifetime needed for the callbacks.  If
the callbacks are only used while the called function is executing (say,
perhaps for a progress indicator or internal completion callback) then
it's safe to create the function wrapper just within the function call.

-- David

More information about the Python-list mailing list