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

2018-05-22 Thread Serhiy Storchaka
Serhiy Storchaka 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 s

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

2018-05-22 Thread Sascha
New submission from Sascha : Try from types import SimpleNamespace import copy class Person(SimpleNamespace): def __init__(self, name, **kwargs): self.name = name super().__init__(**kwargs) bob = Person('Bob', job='tester') clone = copy.copy(bob) For me this results in Typ