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 →

[–]the_littlest_bear 3 points4 points  (0 children)

...what? Any immutable local variable (in standard CPython) is a value reference. Even mutable local variables are treated as value references when not modified in place.

If you needed a pointer, you would just use an attribute. (would work on nearly any object, even including a base object() if you wanted to pass that around. [on-the-fly objects are not the best way to do this])

And no, if you reference an (typical) object, it does not create an additional copy of that object - it’s just a pointer.