[issue44248] copy.deepcopy calls objdect's __deepcopy__ with incorrect argument
Zachary Ware
report at bugs.python.org
Thu May 27 22:26:08 EDT 2021
Zachary Ware <zachary.ware at gmail.com> added the comment:
Actually, looking into the implementation a bit, I can say there is definitely no bug here. Line 153 basically works out to `y = x.__deepcopy__(memo)`, which is how the `__deepcopy__` method is documented[1] to be called. Calling `copier(x)` instead would cause serious problems when a well-behaved `__deepcopy__` method then tries to call `deepcopy(self.some_attribute, memo)`.
As such, I'm closing this issue as "not a bug".
[1] https://docs.python.org/3/library/copy.html (see the last paragraph)
----------
resolution: -> not a bug
stage: -> resolved
status: open -> closed
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44248>
_______________________________________
More information about the Python-bugs-list
mailing list