It is possible for a dataclass field to define init=False, which means that field cannot be initialized via the __init__() method. This is a problem for the binder, as it passes all parsed fields to __init__().
The use case for init=False offered by the standard library documentation is to mark fields initialized via __post_init__(). This use case would be satisfied by simply having the binder ignore all fields with init=False.
See this TODO comment:
https://github.com/ProtixIT/dataclass-binder/blob/8e747018517dddfa91bdf4c3413126759779fbba/src/dataclass_binder/_impl.py#L2
It is possible for a dataclass field to define
init=False
, which means that field cannot be initialized via the__init__()
method. This is a problem for the binder, as it passes all parsed fields to__init__()
.The use case for
init=False
offered by the standard library documentation is to mark fields initialized via__post_init__()
. This use case would be satisfied by simply having the binder ignore all fields withinit=False
.