You can already specify a default value by assigning to a dataclass field as you would expect; but there are cases where you may want to specify a different default value for deserialization (or not have a default value in code at all).
from databind.core.settings import Default
@dataclass
class MyClass:
a: Annotated[str, Default("foo")]
This setting would ensure that a has default value foo when deserialized, but not when the dataclass is constructed in Python code.
You can already specify a default value by assigning to a dataclass field as you would expect; but there are cases where you may want to specify a different default value for deserialization (or not have a default value in code at all).
This setting would ensure that
ahas default valuefoowhen deserialized, but not when the dataclass is constructed in Python code.