[issue5710] ctypes should return composite types from callbacks

2017-11-22 Thread Russell Keith-Magee
Russell Keith-Magee added the comment: For those interested, we developed a workaround for this in Rubicon: https://github.com/pybee/rubicon-objc/pull/85/files The fix involves using ctypes to access ctypes own internals, and build a modified version of the Structure

[issue5710] ctypes should return composite types from callbacks

2017-11-22 Thread Pam McA'Nulty
Pam McA'Nulty added the comment: oops - "In the example code, the 'result' variable is declared on the stack in the callback() function. So it will be effectively when callback() returns." should be "In the example code, the 'result' variable is declared on the stack

[issue5710] ctypes should return composite types from callbacks

2017-11-22 Thread Pam McA'Nulty
Pam McA'Nulty added the comment: In the example code, the 'result' variable is declared on the stack in the callback() function. So it will be effectively when callback() returns. Also the "result" variable in main() is never referenced. A pointer main()'s "result"

[issue5710] ctypes should return composite types from callbacks

2015-11-29 Thread Albert Zeyer
Albert Zeyer added the comment: Any update here? -- nosy: +Albert.Zeyer versions: +Python 2.7 ___ Python tracker ___

[issue5710] ctypes should return composite types from callbacks

2013-09-27 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- assignee: theller - versions: +Python 3.4 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5710 ___

[issue5710] ctypes should return composite types from callbacks

2013-09-27 Thread Mason Bially
Mason Bially added the comment: I agree with Amaury that this is purely a user side concern. While I think it's important to note the behaviour of ctypes in the case that Thomas describes, I believe it's more important to fully support the range of behaviours allowed by C function callbacks.

[issue5710] ctypes should return composite types from callbacks

2010-08-03 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- stage: - unit test needed type: - feature request versions: +Python 3.2 -Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1 ___ Python tracker rep...@bugs.python.org

[issue5710] ctypes should return composite types from callbacks

2009-04-07 Thread Thomas Heller
Thomas Heller thel...@ctypes.org added the comment: There is a problem returning arbitrary complicated ctypes types from callbacks. Consider that a callback function returns a structure; the structure itself may contain 'char *' field for example. The callback function creates the structure

[issue5710] ctypes should return composite types from callbacks

2009-04-07 Thread Amaury Forgeot d'Arc
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

[issue5710] ctypes should return composite types from callbacks

2009-04-06 Thread Greg Holling
New submission from Greg Holling gholl...@vni.com: We have an application that calls a 3rd party library that returns a structure (by value) from a callback. I'm including some sample code that duplicates the behavior. The problem is that return types from callbacks cannot be anything other