Amaury Forgeot d'Arc <amaur...@gmail.com> added the comment:

But isn't this purely a user-side concern?

For example, if I want to use a function such as QBuffer::setBuffer in 
the Qt library:
http://doc.trolltech.com/4.4/qbuffer.html#setBuffer
I must keep a reference to the buffer as long as the QBuffer is alive, 
or expect a crash.

Returning a pointer from a function is always tough, even in C: 
everybody has already tried to return the address of a local variable...
the pointer must belong to some container that outlives the function 
call.
ctypes is not different in this aspect. The same precautions as in C 
apply. And with a warning note in the documentation, there seems to be 
no reason to limit the return type of a callback.

----------
nosy: +amaury.forgeotdarc

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5710>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to