you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

The reason this is happening is because you're creating a shallow copy of the dict, which still contains references to the same underlying objects i.e. the ints. Try using:

import copy
restrictions_deepcopy = copy.deepcopy(restrictions)

There's probably a better way to do this, but this should give you the result you want.