1111
1212from .._compat import is_subclass
1313from ..cols import is_mapping , is_namedtuple , namedtuple_unstructure_factory
14- from ..converters import BaseConverter , Converter
14+ from ..converters import Converter
1515from ..fns import identity
1616from ..literals import is_literal_containing_enums
1717from ..strategies import configure_union_passthrough
@@ -28,7 +28,7 @@ def loads(self, data: Union[bytes, bytearray, memoryview, str], cl: type[T]) ->
2828 return self .structure (loads (data ), cl )
2929
3030
31- def configure_converter (converter : BaseConverter ):
31+ def configure_converter (converter : Converter ):
3232 """
3333 Configure the converter for use with the orjson library.
3434
@@ -40,9 +40,9 @@ def configure_converter(converter: BaseConverter):
4040 * mapping keys are coerced into strings when unstructuring
4141 * bare, string and int enums are passed through when unstructuring
4242
43- .. versionchanged: 24.1.0
43+ .. versionchanged:: 24.1.0
4444 Add support for typed namedtuples.
45- .. versionchanged: 24.2.0
45+ .. versionchanged:: 24.2.0
4646 Enums are left to the library to unstructure, speeding them up.
4747 """
4848 converter .register_unstructure_hook (
@@ -53,7 +53,7 @@ def configure_converter(converter: BaseConverter):
5353 converter .register_structure_hook (datetime , lambda v , _ : datetime .fromisoformat (v ))
5454 converter .register_structure_hook (date , lambda v , _ : date .fromisoformat (v ))
5555
56- def gen_unstructure_mapping (cl : Any , unstructure_to = None ):
56+ def unstructure_mapping_factory (cl : Any , unstructure_to = None ):
5757 key_handler = str
5858 args = getattr (cl , "__args__" , None )
5959 if args :
@@ -77,7 +77,7 @@ def key_handler(v):
7777
7878 converter ._unstructure_func .register_func_list (
7979 [
80- (is_mapping , gen_unstructure_mapping , True ),
80+ (is_mapping , unstructure_mapping_factory , True ),
8181 (
8282 is_namedtuple ,
8383 partial (namedtuple_unstructure_factory , unstructure_to = tuple ),
0 commit comments