adding also values that are not part of the dataclass to the "TContainer" while parsing

This commit is contained in:
Tim Rid 2021-01-24 17:49:39 +01:00
parent 419353c712
commit 8be150b090

View file

@ -142,6 +142,9 @@ class _TStruct(Adapter[t.Any, t.Any, ContainerType, BuildTypes]):
value = getattr(obj, field.name)
setattr(dc, field.name, value)
# also transfer values that are not part of the dataclass
dc.update(obj)
return dc
def _encode(