You can embed each element in your own mutable data structure (e.g. list ).
>>> l=[1,2,3,4,5] >>> l = [[item] for item in l] >>> l [[1], [2], [3], [4], [5]] >>> a = l[:2] >>> a [[1], [2]] >>> l[0][0] = 10 >>> l [[10], [2], [3], [4], [5]] >>> a [[10], [2]]
However, I recommend coming up with a solution to your original problem (whatever it was) that does not create your own problems.
source share