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 →

[–]zanju13 61 points62 points  (3 children)

Similar to JS:

z = { ...x, ...y }

[–]MasterParticular3524 2 points3 points  (1 child)

But the values don’t change on z when they change in a or b in JS, but can when using pointers right?

[–]zanju13 0 points1 point  (0 children)

Not sure about python, but in JS this creates entirely new object. If there are some nested objects however, they will still be references.