Message301120
> When using nested SimpleNamespaces, a making a copy by using
>
> new_NS=SimpleNamespace(**namespace.__dict__.copy())
In general, you shouldn't call or directly access dunder attributes.
There are exceptions, but generally they're for Python's use only. For
example, the public interface for getting __dict__ is to call
vars(namespace).
But there's no need to do this by hand. Use the copy module instead.
copy.copy(namespace) # copy one level only
copy.deepcopy(namespace) # copy all the way down
seem to work for me.
Does this solve your problem? If so, we'll close this issue. |
|
Date |
User |
Action |
Args |
2017-09-01 15:06:19 | steven.daprano | set | recipients:
+ steven.daprano, yselivanov, Pritish Patil |
2017-09-01 15:06:19 | steven.daprano | link | issue31322 messages |
2017-09-01 15:06:19 | steven.daprano | create | |
|