Call by reference in SWIG?

Joe Strout joe at strout.net
Thu Dec 11 16:43:00 CET 2008


On Dec 10, 2008, at 10:19 PM, Nok wrote:

> I can't get call-by-reference functions to work in SWIG...

Python doesn't have any call-by-reference support at all [1], so I'm  
not surprised that a straight translation of the call-by-reference C  
function doesn't work.

Unfortunately I don't know enough about SWIG to suggest a work- 
around.  Hopefully someone more versed in SWIG will have a bright  
idea.  If you don't find anything in the Python space, you might try  
poking around in Java references, since Java has the same call  
semantics as Python.

Best wishes,
- Joe

[1] http://www.strout.net/info/coding/valref/




More information about the Python-list mailing list