newbie question

rihad rihad at mail.ru
Sun Jan 13 10:00:48 EST 2002


Hi, I'm new to Python and am making my way through the bundled
tutorial. As I now understand, variables in Python are really
references (everything is passed by object reference). If I have this
code:

def f(n, x = []):
   # some code

Even if I don't modify x inside f(), is it guaranteed that x will
always be [], that is, the empty list [] will never be shared with
some unrelated reference, which could modify it, and thus affect what
x binds to?




More information about the Python-list mailing list