def changer(x, y): x = 2 # changes local name's value only y[0] = 'spam' # changes shared object in-place