This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: copy.deepcopy does not respect metaclasses with __deepcopy__ implementations
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: elibixby
Priority: normal Keywords:

Created on 2018-12-04 20:04 by elibixby, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 10903 elibixby, 2018-12-04 20:04
Messages (1)
msg331073 - (view) Author: Eliot Bixby (elibixby) * Date: 2018-12-04 20:04
__deepcopy__ implementations on metaclasses are ignored because deepcopy explicitly ignores class objects.

It seems to me that more consistent behavior would be to use a null op as a fallback for class objects that do not have any of the relevant methods implemented (deepcopy, reduce, reduce_ex, etc)

I've attached a PR that implements this.
History
Date User Action Args
2022-04-11 14:59:08adminsetgithub: 79591
2018-12-04 20:04:54elibixbycreate