Closed morrison12 closed 4 weeks ago
Interesting. If I remove @dataclass
decorator. It looks like this
test=Foo(a=1) get_meta(test, "a")=mappingproxy({'serde_skip': True}) found: True
test=Bar(a=1) get_meta(test, "a")=mappingproxy({'serde_skip': True}) found: True
test=Baz(a=1) get_meta(test, "a")=mappingproxy({'serde_skip': True}) found: True
test=Qux(a=1) get_meta(test, "a")=mappingproxy({'serde_skip': True}) found: True
Foo {}
Bar {}
Baz {}
Qux {}
Hi @morrison12 I made #584 . Can you please check?
Hello @yukinarit. That solves it in both cases.
Even with the workaround from issue #426 applied, it appears the use of
InitVar
in a dataclass that has explicitly been decorated with@serde
, somehow interferes withserdes'
use of metadata: at least theskip=
option is not recorded and thus the marked field appears in the output.In the following example one would expect to see the relevant metadata and correct output in all four cases but instead only
Foo
(where there is the decorator but noInitVar
) andQux
(where there is no decorator but there is anInitVar
) work.There is a, at least conceptually, related problem with input processing in the presence of an
InitVar
with an example in issue #582 .Example
Output
Environment Details