passing by refference

Peter Maas peter.maas at mplusr.de
Tue May 13 11:26:13 EDT 2003


Daan Hoogland wrote
> is passing by reffence possible in python?

No, not directly. You can embed values in a container
(list, dictionary, object) and use the container as
argument. List example:

def spam(aList):
     aList[0]=4

eggs = [1 2 3]
spam(eggs)
print eggs # prints [4 2 3]

Mit freundlichen Gruessen,

Peter Maas

-- 
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
Tel +49-241-93878-0 Fax +49-241-93878-20 eMail peter.maas at mplusr.de
-------------------------------------------------------------------





More information about the Python-list mailing list