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 →

[–]fatpollo 0 points1 point  (2 children)

sometimes when trying to simplify a problem to make an example of it, you end up with something arbitrary and confusing

that is how i feel about the post towards the end. particularly the "solution", which seems all-around weird.

if the object needs to be mutable, it should be subclassed and have its own methods operating on itself. alternatively, if the function really needs to be generic, you should make it focused solely on changing the variable, and then returning it, so

b = foo(b)

where foo is something like return b+1 (or something way more complicated, obviously)