-----Ursprüngliche Nachricht----- Von: Arenz, Ralph Gesendet: Freitag, 23. Februar 2001 16:24 An: 'Daniel Rusch' Betreff: AW: [Zope] call by reference They are non object related methods and in the same file. I think i found a way to solve the problem. Do I have to work with the 'global' statement , like this ? e.g: modul_foo: def foo2(): x,y=2,3 foo(x,y) def foo(foo1,foo2): global x,y x=foo1+1 y=foo2+1 Result in foo2: x=3 , y=4 ? ralph -----Ursprüngliche Nachricht----- Von: Daniel Rusch [mailto:drusch@globalcrossing.com] Gesendet: Freitag, 23. Februar 2001 16:18 An: Arenz, Ralph Betreff: Re: [Zope] call by reference Are foo() and foo2() in the same file? Are they members of the same object or are they non object related methods? Dan "Arenz, Ralph" wrote:
Hi,
for some external methods in zope i have do write some python scripts.
Here my question: I want do a 'function - call by reference' in python.
My function definition is like that:
def foo(foo1,foo2): foo1=1 foo2=2
My intention is to call the function from an other function in the python script like
def foo2(): x,y=2,3 foo(x,y)
I know that python is working with seperate namespaces in case of function calls, but is there a work-around for this problem.
ralph
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (1)
-
Arenz, Ralph