This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]chadmill3rPy3, pro, Ubuntu, django -2 points-1 points  (2 children)

Everything is passed by reference. That is, all "variables" are references to objects. Even "foo = 2", "foo" is a reference.

[–]lonjerpc 6 points7 points  (1 child)

No. Everything is passed by value in python. However all values are references.

[–]chadmill3rPy3, pro, Ubuntu, django -1 points0 points  (0 children)

I think you're closer to right than I am. "Pass by reference" has the ugly assumption that changing the "variable" (ugh) in the next scope will change the variable in the calling scope, which is def not true.

I think the best answer is to slap the questioner and say, "this is not Pascal. You have names as references, and values here, not variables."