11 lines
247 B
Python
11 lines
247 B
Python
class TestObj:
|
|
def __init__(self, *args, **kwargs):
|
|
for arg in args:
|
|
self.__setattr__(arg, None)
|
|
|
|
for key, val in kwargs.items():
|
|
self.__setattr__(key, val)
|
|
|
|
@classmethod
|
|
def from_dict(cls, raw):
|
|
return cls(**raw) |