File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77from cbor2 import dumps , loads
88
99from ..converters import BaseConverter , Converter
10+ from ..fns import identity
1011from ..literals import is_literal_containing_enums
1112from ..strategies import configure_union_passthrough
12- from . import (
13- is_primitive_enum ,
14- literals_with_enums_unstructure_factory ,
15- primitive_enum_unstructure_factory ,
16- wrap ,
17- )
13+ from . import is_primitive_enum , literals_with_enums_unstructure_factory , wrap
1814
1915T = TypeVar ("T" )
2016
@@ -41,9 +37,7 @@ def configure_converter(converter: BaseConverter):
4137 )
4238 converter .register_unstructure_hook (date , lambda v : v .isoformat ())
4339 converter .register_structure_hook (date , lambda v , _ : date .fromisoformat (v ))
44- converter .register_unstructure_hook_factory (
45- is_primitive_enum , primitive_enum_unstructure_factory
46- )
40+ converter .register_unstructure_hook_factory (is_primitive_enum , identity )
4741 converter .register_unstructure_hook_factory (
4842 is_literal_containing_enums , literals_with_enums_unstructure_factory
4943 )
You can’t perform that action at this time.
0 commit comments