-
-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Description
Hi! It seems like currently converter with omit_if_default=True does not apply attrs' converters when checking if the value is equal to the default one.
import attrs
import cattrs
c = cattrs.Converter(omit_if_default=True)
@attrs.define
class A:
b: int = attrs.field(default="0", converter=int)
c.unstructure(A())
# {'b': 0}
@attrs.define
class A:
b: int = attrs.field(default=0, converter=int)
c.unstructure(A())
# {}Is this the expected behavior? If so, would you consider changing it?
Metadata
Metadata
Assignees
Labels
No labels