Open maticus opened 4 months ago
The 'cast' option has subclassing support:
It also works with base classes - if T is a base class of type S, all fields of type S will be also "casted".
I'd love to see this in type_hooks as well.
One concrete use case that I have is I'd like to create Enums using their members' names (not values).
I second that.
I currently use a decorator to register enums to the hooks individually but that adds unnecessary shared state that could be removed.
The 'cast' option has subclassing support:
I'd love to see this in type_hooks as well.
One concrete use case that I have is I'd like to create Enums using their members' names (not values).