Python copy.deepcopy() function not working properly [duplicate]
问题 This question already has answers here : How to copy a python class? (8 answers) Closed 5 years ago . I have been playing with the deepcopy function and the copy function and I get the same issue with both of them. It is like the copy was a reference (or a pointer) instead of a proper copy. I am working with data records (classes) in Python, maybe it could be that.. I show you an example: >>> import copy >>> class player1: ... age = 23 ... score = 1 >>> class player2: ... age = 14 ... score =