Passing arguments to function - (The fundamentals are confusing me)

Gregory Piñero gregpinero at
Tue Aug 9 16:53:15 CEST 2005

Hey guys, would someone mind giving me a quick rundown of how
references work in Python when passing arguments into functions?  The
code below should highlight my specific confusion:



def func1(arg1): arg1.append(4)

def func2(arg1): arg1=False




Why does my list variable get changed for the rest of the program, but
my boolean variable doesn't.  What am I not understanding?

Gregory Piñero
Chief Innovation Officer
Blended Technologies

More information about the Python-list mailing list