On Thu, 29 Nov 2007 14:39:52 -0800 (PST), [EMAIL PROTECTED] wrote:
>I understand the parameters to Python functions are passed by
>reference:
>
>def foo(a):
>  a = a + 1
>
>Will change the value of a in the calling function. How do I implement
>the equivalent in C when extending Python?

You misunderstand how parameters are passed in Python:

    >>> x = 10
    >>> def foo(y):
    ...     y = y + 1
    ...
    >>> foo(x)
    >>> x
    10
    >>>

So there's no behavior here to attempt to emulate when embedding or extending.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to