Correct Style for Python functions that mutate the argument
I would like to write a Python function that mutates one of the arguments (which is a list, ie, mutable). Something like this: def change(array): array.append(4) change(array) I'm more familiar with passing by value than Python's setup (whatever you decide to call it). So I would usually write such a function like this: def change(array): array.append(4) return array array = change(array) Here's my confusion. Since I can just mutate the argument, the second method would seem redundant. But the first one feels wrong. Also, my particular function will have several parameters, only one of which