Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调用 copy.copy 得到深度拷贝的结果! #11

Open
2018-11-27 opened this issue May 13, 2023 · 1 comment
Open

调用 copy.copy 得到深度拷贝的结果! #11

2018-11-27 opened this issue May 13, 2023 · 1 comment
Assignees
Labels
bug Something isn't working Processed

Comments

@2018-11-27
Copy link
Member

经分析,确认原因在于 gdict 类初始化的逻辑与常规类不同,gdict 类初始化过程可以说是一个(不完全的)深度拷贝。
copy.copy 调用过程就是直接创建一个相同类的对象,这样就像如上所述得到深度拷贝的结果。

@2018-11-27 2018-11-27 added the bug Something isn't working label May 13, 2023
@2018-11-27 2018-11-27 self-assigned this May 13, 2023
2018-11-27 pushed a commit that referenced this issue May 13, 2023
1. Fix issue where a new `gdict` instance was still created even when the value being assigned as a key-value pair was already an instance of `gdict`. #10
2. Fix issue where calling `copy.copy` did not result in a deep copy. #11
3. Add extensive and detailed functionality descriptions to the `gdict` class.
4. Adjust the functionality description of the `deepcopy` method.
5. Refactor (improve) the method of obtaining version information in `setup` by directly extracting it from `package.__doc__`, rather than opening a file.
6. Adjust the classification information of the open-source library on PyPi.
7. Update the README file to provide detailed explanations of the functionality and usage of `gdict`.

1.修复问题:设置键值对时,如果值已经是 `gdict` 实例,仍然会创建新的 `gdict`实例。#10
2.修复问题:调用 `copy.copy` 得到深度拷贝的结果。#11
3.对 `gdict` 类添加了大量的详细的功能描述。
4.调整 `deepcopy` 方法的功能描述。
5.重构(改进) `setup` 中获得版本信息的方案,直接从 `package.__doc__` 中提取,而不再打开文件。
6.调整在PyPi上的开源库分类信息。
7.更新自述文件,详细地讲解 `gdict` 的功能和用法。
@2018-11-27
Copy link
Member Author

问题已修复 7052e98,版本: 1.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Processed
Projects
None yet
Development

No branches or pull requests

1 participant