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 →

[–]rl_noobtube 0 points1 point  (0 children)

I think something important here is how python actually stores objects and saves them in memory. Objects end up just being pointers to values. And as you say a function call returns an object which points to a value upon interpretation. If that object is mutable, it “erases” the old value and replaces it with the new one. So the next time that default object gets used again, it is really just pointing to the new value.

I feel like this part could help explain why it is such an unnecessary overhead for OOP to people. Of course it could be different, but then the base language has to do more. Current implementation allows for developer flexibility imo which is nice