typedparser 0.22.6__tar.gz → 0.22.7__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: typedparser
3
- Version: 0.22.6
3
+ Version: 0.22.7
4
4
  Summary: Extension for python argparse with typehints and typechecks.
5
5
  Author: simon-ging
6
6
  License: Apache-2.0
@@ -25,4 +25,4 @@ __all__ = [
25
25
  ]
26
26
 
27
27
 
28
- __version__ = "0.22.6"
28
+ __version__ = "0.22.7"
@@ -166,9 +166,7 @@ def flatten_dict(
166
166
  parser = parser_class()
167
167
 
168
168
  def _check_key(key_inner):
169
- assert (
170
- separator_for_dict not in key_inner and separator_for_list not in key_inner
171
- ), (
169
+ assert separator_for_dict not in key_inner and separator_for_list not in key_inner, (
172
170
  f"Separators '{separator_for_dict}' and '{separator_for_list}' not allowed in key "
173
171
  f"'{key_inner}' when flattening dict."
174
172
  )
@@ -180,9 +178,7 @@ def flatten_dict(
180
178
  k_inner_str = str(k_inner)
181
179
  _check_key(k_inner_str)
182
180
  items_inner.extend(
183
- _flatten_leaf(
184
- v_inner, prefix=f"{prefix}{separator_for_dict}{k_inner_str}"
185
- )
181
+ _flatten_leaf(v_inner, prefix=f"{prefix}{separator_for_dict}{k_inner_str}")
186
182
  )
187
183
  elif parser.is_iterable_fn(d_inner):
188
184
  for i, v_inner in enumerate(d_inner):
@@ -254,9 +250,7 @@ def compare_nested_objects(
254
250
  else:
255
251
  for i, v in enumerate(d1):
256
252
  all_errors.extend(
257
- _compare_nested_objects(
258
- v, d2[i], depth + 1, prefix=f"{prefix}[{i}]"
259
- )
253
+ _compare_nested_objects(v, d2[i], depth + 1, prefix=f"{prefix}[{i}]")
260
254
  )
261
255
  return all_errors
262
256
 
@@ -273,9 +267,7 @@ def compare_nested_objects(
273
267
  # check if attributes are defined in the same way
274
268
  d1_att = getattr(d1, att_name)
275
269
  d2_att = getattr(d2, att_name)
276
- if type(d1_att) != type(
277
- d2_att
278
- ): # noqa # pylint: disable=unidiomatic-typecheck
270
+ if type(d1_att) != type(d2_att): # noqa # pylint: disable=unidiomatic-typecheck
279
271
  all_errors.append(
280
272
  f"{prefix} Attribute {att_name} type mismatch: "
281
273
  f"({type(d1_att)}) != ({type(d2_att)})"
@@ -346,9 +338,7 @@ def big_obj_to_short_str(d: Any) -> str:
346
338
  return f"Object of type {class_name}"
347
339
 
348
340
 
349
- def invert_dict_of_dict(
350
- dict_of_dict: dict[str, dict[str, any]]
351
- ) -> dict[str, dict[str, any]]:
341
+ def invert_dict_of_dict(dict_of_dict: dict[str, dict[str, any]]) -> dict[str, dict[str, any]]:
352
342
  """
353
343
  Invert a dictionary of dictionaries. Useful for creating dataframes.
354
344
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: typedparser
3
- Version: 0.22.6
3
+ Version: 0.22.7
4
4
  Summary: Extension for python argparse with typehints and typechecks.
5
5
  Author: simon-ging
6
6
  License: Apache-2.0
File without changes
File without changes
File without changes