So that if the slice gets changed, the original array will also change?
a = [1, 2, 3] b = a[1, 2] b[0] = 42 # due to COW, only b changes, a remains unchanged
Expected result: when run b[0] = 42, a[1] will also changed to 42.
b[0] = 42
a[1]
Aucun commentaire:
Enregistrer un commentaire