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.

Author eric.snow
Recipients Pritish Patil, eric.snow, steven.daprano, yselivanov
Date 2017-09-01.15:08:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504278492.01.0.65006482317.issue31322@psf.upfronthosting.co.za>
In-reply-to
Content
Hmm.  What problems are you seeing with deep copies?  copy.deepcopy() should work since SimpleNamespace is picklable. [1][2]  I don't have any problems:

>>> import types, copy
>>> ns = types.SimpleNamespace(x=1, y=2)
>>> copied = copy.deepcopy(ns)
>>> copied
namespace(x=1, y=2)
>>> ns = types.SimpleNamespace(x=types.SimpleNamespace(a=1),
                               y=types.SimpleNamespace(b=2))
>>> copied = copy.deepcopy(ns)
>>> copied
namespace(x=namespace(a=1), y=namespace(b=2))
>>> ns.x is copied.x
False

[1] issue #15022
[2] https://docs.python.org/3/library/copy.html
History
Date User Action Args
2017-09-01 15:08:12eric.snowsetrecipients: + eric.snow, steven.daprano, yselivanov, Pritish Patil
2017-09-01 15:08:12eric.snowsetmessageid: <1504278492.01.0.65006482317.issue31322@psf.upfronthosting.co.za>
2017-09-01 15:08:12eric.snowlinkissue31322 messages
2017-09-01 15:08:11eric.snowcreate