Re: C API: passing by reference

2007-06-23 Thread [EMAIL PROTECTED]
Thanks for that clarification Martin. When I googled it before, the first page I read said "Python passes all arguments using 'pass by reference'." However, after seeing your reply and further searching I see that this is not true. I have a python function insertEdge which takes to 2-tuples of (fa

Re: C API: passing by reference

2007-06-23 Thread Carsten Haese
On Sat, 2007-06-23 at 18:25 +, [EMAIL PROTECTED] wrote: > I'm writing my own python extension module with the C API. In python > all functions pass arguments by reference, "Pass by reference", while correct from a certain standpoint, is to be taken with a large grain of salt. It is correct in

Re: C API: passing by reference

2007-06-23 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > I'm writing my own python extension module with the C API. In python > all functions pass arguments by reference Can you please show an example what you mean by that? There is no "pass-by-reference" in Python: a function can not normally modify the variable in the call

C API: passing by reference

2007-06-23 Thread [EMAIL PROTECTED]
I'm writing my own python extension module with the C API. In python all functions pass arguments by reference, but how can I make use of this in C? Right now, I am using: PyArg_ParseTuple(args, "(ii)(ii)", &faceId1, &vertId1, &faceId2, &vertId2) I want the to change the faceId's in my function.