David Bolen <db3l....@gmail.com> wrote: > Nick Craig-Wood <n...@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.
Good point... However I wouldn't mind if ctypes emitted a warning or even threw an exception in this case too though as the other case is so invidious. -- Nick Craig-Wood <n...@craig-wood.com> -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list