[issue33599] Copying objects subclassed from SimpleNamespace doesn't work

Serhiy Storchaka report at bugs.python.org
Tue May 22 06:20:33 EDT 2018


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Right, this is because your subclass is not completely compatible with SimpleNamespace. The SimpleNamespace constructor accepts only keyword arguments, but your class requires a positional argument. You have to implement the __copy__ method for supporting shallow copying and the __deepcopy__ method for supporting deep copying. Or the __reduce__ method for supporting both shallow and deep copying and pickling.

----------
nosy: +serhiy.storchaka
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33599>
_______________________________________


More information about the Python-bugs-list mailing list