typedparser 0.22.4__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
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: typedparser
3
- Version: 0.22.4
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.4"
28
+ __version__ = "0.22.7"
@@ -26,10 +26,26 @@ def get_attr_names(cls: AttrsClass) -> List[str]:
26
26
  return [att.name for att in fields(cls)] # noqa
27
27
 
28
28
 
29
- def get_all_base_classes(klass: type) -> List[type]:
30
- for base in klass.__bases__:
31
- yield base
32
- yield from get_all_base_classes(base)
29
+ # def _get_all_base_classes_rec(klass: type) -> Generator[type, None, None]:
30
+ # for base in klass.__bases__:
31
+ # yield base
32
+ # yield from _get_all_base_classes_rec(base)
33
+
34
+
35
+ def get_all_base_classes(input_class: type) -> List[type]:
36
+ classes = {}
37
+
38
+ def _get_all_base_classes_rec(class_here: type):
39
+ for base in class_here.__bases__:
40
+ if base == object:
41
+ continue
42
+ if base in classes:
43
+ continue
44
+ classes[base] = base
45
+ _get_all_base_classes_rec(base)
46
+
47
+ _get_all_base_classes_rec(input_class)
48
+ return list(classes.values())
33
49
 
34
50
 
35
51
  def is_standard_mapping(d: Any) -> bool:
@@ -274,9 +290,10 @@ def compare_nested_objects(
274
290
  def _compare_leaf(
275
291
  d1: Any, d2: Any, _depth: int, rtol=1.0e-5, atol=1.0e-8, equal_nan=False, prefix=""
276
292
  ) -> List[str]:
293
+
277
294
  # at this point the 2 leaves are guaranteed to be the same type
278
- if np is not None and isinstance(d1, np.ndarray):
279
- comp = np.allclose(d1, d2, rtol=rtol, atol=atol, equal_nan=equal_nan)
295
+ if np is not None and isinstance(d1, np.ndarray): # noqa
296
+ comp = np.allclose(d1, d2, rtol=rtol, atol=atol, equal_nan=equal_nan) # noqa
280
297
  else:
281
298
  comp = d1 == d2
282
299
  if not comp:
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: typedparser
3
- Version: 0.22.4
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