Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clarified and improved copy() methods of NocaseDict and CIM objects
Details: 1. The copy() methods of `NocaseDict`and of the CIM object classes were not quite specific as to whether they produce deep or shallow copies. This change clarifies that they produce middle-deep copies, where some mutable leaf attributes are not copied and thus are shared between original and copy. 2. Added a note that copy.copy() and copy.deepcopy() can be used to create completely shallow or completely deep copies, which was the reason to leave the middle-deep implementation as it was and just documented it properly. 3. Removed one level of superflous copies of dictionaries in the copy() methods of the CIM object classes. These dictionaries are already copied in the setter merthods for the respective attribute. 4. Changed the path argument of CIMInstance to be deep copied, because it may be modified by setting properties. Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
- Loading branch information