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

Created on 2018-12-04 20:04 by elibixby, last changed 2018-12-04 20:04 by elibixby.

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.
Date User Action Args
2018-12-04 20:04:54elibixbycreate