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
Describe the bug
Builtin classes and enums are able to be set as default values in optional fields. dataclasses are not and the default value is replaced with a None.
Additional context
In addition, there is no way to toggle the optional fields to None if None isn't already the default. BooleanOptionalAction only sets the flag to False, but some classes like lightning.pytorch.callbacks.DeviceStatsMonitor have three modes (None/False/True) and that isn't that clearly representable yet. I think this will be easier though. The dataclass default issue seems more challenging.
The text was updated successfully, but these errors were encountered:
Describe the bug
Builtin classes and enums are able to be set as default values in optional fields.
dataclass
es are not and the default value is replaced with aNone
.To Reproduce
Expected behavior
I would expect
a
in this example to be nonnull since it has a default value.Actual behavior
Instead the
a
field is None.Desktop:
Additional context
In addition, there is no way to toggle the optional fields to
None
ifNone
isn't already the default.BooleanOptionalAction
only sets the flag toFalse
, but some classes like lightning.pytorch.callbacks.DeviceStatsMonitor have three modes (None
/False
/True
) and that isn't that clearly representable yet. I think this will be easier though. Thedataclass
default issue seems more challenging.The text was updated successfully, but these errors were encountered: