You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is related to #333. Before #334, init=False fields would end up being passed to the __init__ method during deserialization. After #334, that's no longer the case, however, when this is mixed with inheritance I see the init=False fields pop up in the subclasses.
here the initialization of bar fails with the familiar:
Traceback (most recent call last):
File "/workspaces/aurora/.venv/lib/python3.10/site-packages/serde/de.py", line 400, in from_obj
return deserializable_to_obj(c)
File "/workspaces/aurora/.venv/lib/python3.10/site-packages/serde/de.py", line 380, in deserializable_to_obj
res = serde_scope.funcs[func_name](cls, maybe_generic=maybe_generic, data=o, reuse_instances=reuse_instances)
File "<string>", line 29, in from_dict
serde.compat.UserError: ConcreteA.__init__() takes 3 positional arguments but 4 were given
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/workspaces/aurora/check.py", line 54, in <module>
bar = from_json(ConcreteA, to_json(foo))
File "/workspaces/aurora/.venv/lib/python3.10/site-packages/serde/json.py", line 77, in from_json
return from_dict(c, de.deserialize(s, **opts), reuse_instances=False)
File "/workspaces/aurora/.venv/lib/python3.10/site-packages/serde/de.py", line 486, in from_dict
return from_obj(cls, o, named=True, reuse_instances=reuse_instances)
File "/workspaces/aurora/.venv/lib/python3.10/site-packages/serde/de.py", line 460, in from_obj
raise e.inner
File "<string>", line 19, in from_dict
TypeError: ConcreteA.__init__() takes 3 positional arguments but 4 were given
The text was updated successfully, but these errors were encountered:
I think this is related to #333. Before #334,
init=False
fields would end up being passed to the__init__
method during deserialization. After #334, that's no longer the case, however, when this is mixed with inheritance I see theinit=False
fields pop up in the subclasses.Here is an example:
here the initialization of
bar
fails with the familiar:The text was updated successfully, but these errors were encountered: