@@ -184,10 +184,10 @@ def is_dict_extractor(d: dict) -> bool:
184
184
return is_extractor
185
185
186
186
187
- recording_dict_element = namedtuple (typename = "recording_dict_element " , field_names = ["value" , "name" , "access_path" ])
187
+ extractor_dict_element = namedtuple (typename = "extractor_dict_element " , field_names = ["value" , "name" , "access_path" ])
188
188
189
189
190
- def extractor_dict_iterator (extractor_dict : dict ) -> Generator [recording_dict_element ]:
190
+ def extractor_dict_iterator (extractor_dict : dict ) -> Generator [extractor_dict_element ]:
191
191
"""
192
192
Iterator for recursive traversal of a dictionary.
193
193
This function explores the dictionary recursively and yields the path to each value along with the value itself.
@@ -204,7 +204,7 @@ def extractor_dict_iterator(extractor_dict: dict) -> Generator[recording_dict_el
204
204
205
205
Yields
206
206
------
207
- recording_dict_element
207
+ extractor_dict_element
208
208
Named tuple containing the value, the name, and the access_path to the value in the dictionary.
209
209
210
210
"""
@@ -219,7 +219,7 @@ def _extractor_dict_iterator(dict_list_or_value, access_path=(), name=""):
219
219
v , access_path + (i ,), name = name
220
220
) # Propagate name of list to children
221
221
else :
222
- yield recording_dict_element (
222
+ yield extractor_dict_element (
223
223
value = dict_list_or_value ,
224
224
name = name ,
225
225
access_path = access_path ,
@@ -320,7 +320,7 @@ def recursive_path_modifier(d, func, target="path", copy=True) -> dict:
320
320
raise ValueError (f"{ k } key for path must be str or list[str]" )
321
321
322
322
323
- # This is the current definition that an element in a recording_dict is a path
323
+ # This is the current definition that an element in a extractor_dict is a path
324
324
# This is shared across a couple of definition so it is here for DNRY
325
325
element_is_path = lambda element : "path" in element .name and isinstance (element .value , (str , Path ))
326
326
0 commit comments