When the redemption code is written today, when the player redeems the redemption code, he gets the reward for the last redemption code, and has always suspected that the link to the redemption code in MySQL has gone wrong, actually referencing the data in the global constants directly. The data that causes the subsequent global constants uses the reward content of the last redemption code.
Let's talk about the first copy and the deep copy today!
Shallow copy:
Copy.copy: Copy Content
A shallow copy generates a new object, but still uses the reference (address) of the original data, uses a new object for the mutable type operation , does not produce a new object (LIST,DICT) for the immutable type operation, and modifies the corresponding value.
Deep copy:
Copy.deepcopy: Full Copy Content
A deep copy generates a new object, and the elements in the original object are regenerated.
--------------------------------------------------------------
The difference between shallow and deep copying are only relevant for compound objects (objects, contain other Obje CTS, like lists or class instances):
The difference between a shallow copy and a deep copy is only related to composite objects (objects that contain other objects, such as lists or class instances):
- a shallow copy constructs a new compound object and then (to the extent possible) Inserts  references into it to the objects found in The original.
- < Span class= "Apple-converted-space" a shallow copy constructs a new composite object and then inserts (to the extent possible) a reference to its object inserted in the original object.
- a&NBSP; deep copy constructs a new compound object and then, recursively, Inserts&NBSP; copies into it of the objects found In the Origin
- deep copy constructs a new composite object, Then recursively insert it into its
The problems often exist with the deep copy operations that don ' t exist with shallow copy operations:
- Recursive objects (compound objects that, directly or indirectly, contain a reference to themselves) may cause a Recursive Loop.
- Because deep copy copies everything It could copy too much, e.g., administrative data structures that Shoul D be shared even between copies.
Python shallow copy and deep copy