so you want to append to the list and have the function see the effect but have the caller not see it. since the function gets the object (the list) using pass-by-reference the only real way to have that effect is to make a copy of the list. if there are no lists within the list then a shallow copy is sufficient. you can do this in the call like
Python is a language that can do almost anything. it just doesn't always do it the way you want or expect.
test(args[:])
or you do this in the function by assigning a copy to the variable it will be using below.Python is a language that can do almost anything. it just doesn't always do it the way you want or expect.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.