3 ms·
Though my_list.append("blub") does change the outside list. Does this matter?
by eru 17y ago
Though my_list.append("blub") does change the outside list. Does this matter?
- pwmanagerdied 17y agoIn Python you never deal with an object itself, just a reference to it, so you can change the value of any mutable object you pass to a function, lists and dictionaries are just a couple of examples of these. The problem (discussed by the article) is that "pass-by-reference" is a term that is used a couple of different ways. By someone's definition, this property of Python objects might cause them to consider the calls to pass-by-reference, but the way the author defined it in this article they are not.