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:

<code>

bool1=True
lst1=[1,2,3]

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

def func2(arg1): arg1=False

>>func1(lst1)
>>lst1
[1,2,3,4]

>>func2(bool1)
>>bool1
True

</code>

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
(www.blendedtechnologies.com)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to