typedparser 0.31.2__tar.gz → 0.31.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {typedparser-0.31.2 → typedparser-0.31.3}/PKG-INFO +1 -1
- {typedparser-0.31.2 → typedparser-0.31.3}/src/typedparser/__init__.py +1 -1
- {typedparser-0.31.2 → typedparser-0.31.3}/src/typedparser/objects.py +6 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/src/typedparser.egg-info/PKG-INFO +1 -1
- {typedparser-0.31.2 → typedparser-0.31.3}/LICENSE +0 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/README.md +0 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/pyproject.toml +0 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/requirements.txt +0 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/setup.cfg +0 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/src/typedparser/_typedattr.py +0 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/src/typedparser/_typedparser.py +0 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/src/typedparser/custom_format.py +0 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/src/typedparser/funcs.py +0 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/src/typedparser.egg-info/SOURCES.txt +0 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/src/typedparser.egg-info/dependency_links.txt +0 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/src/typedparser.egg-info/requires.txt +0 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/src/typedparser.egg-info/top_level.txt +0 -0
- {typedparser-0.31.2 → typedparser-0.31.3}/src/typedparser.egg-info/zip-safe +0 -0
|
@@ -109,6 +109,8 @@ def modify_nested_object(
|
|
|
109
109
|
"""
|
|
110
110
|
Traverse a python object and apply a modifier function to all leaves.
|
|
111
111
|
|
|
112
|
+
Note: This also modifies tuples and sets.
|
|
113
|
+
|
|
112
114
|
Args:
|
|
113
115
|
d: object to modify (e.g. dict)
|
|
114
116
|
modifier_fn: modifier function to apply to all leaves
|
|
@@ -132,6 +134,10 @@ def modify_nested_object(
|
|
|
132
134
|
if parser.is_mapping_fn(d_inner):
|
|
133
135
|
for k, v in d_inner.items():
|
|
134
136
|
d_inner[k] = recursive_fn(v)
|
|
137
|
+
elif isinstance(d_inner, tuple): # tuple does not support in-place modification
|
|
138
|
+
d_inner = tuple(recursive_fn(v) for v in d_inner)
|
|
139
|
+
elif isinstance(d_inner, set): # set does not support in-place modification
|
|
140
|
+
d_inner = set(recursive_fn(v) for v in d_inner)
|
|
135
141
|
elif parser.is_iterable_fn(d_inner):
|
|
136
142
|
for i, v in enumerate(d_inner):
|
|
137
143
|
d_inner[i] = recursive_fn(v)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|