a = types.SimpleNamespace()
b = dict()
[a.__setattr__(key, value) for key, value in b]
Now I would like to use map
: list(map(a.setattr, b.items()))
, but the item of b.items()
is a tuple, not key and value. I know the Python has the unpack syntax, so I am curious is there any function can unpack sequence too so that I can use it in map
.