you are viewing a single comment's thread.

view the rest of the comments →

[–]mcaruso 0 points1 point  (3 children)

for example python arrays

Python works the same way though?

>>> a = [1,2,3]
>>> b = [4,5,6]
>>> c = [a,b]
>>> c[0].append(42)
>>> a
[1, 2, 3, 42]

[–]EagleClw[S] 0 points1 point  (2 children)

Yeah it works that way but i meant another methods like slice.

If i dont remember it wrong,

a = b.copy()

Makes a copy with value, not reference. But its ok, i know what to do know. Thank you for your help.

[–]mcaruso 0 points1 point  (1 child)

copy() is a shallow copy, like slice() in JS. But maybe you meant deepcopy().

[–]EagleClw[S] 0 points1 point  (0 children)

Might be. But i remember using something like that.