type-analyzer 0.1.0__tar.gz → 0.1.2__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.
- {type_analyzer-0.1.0 → type_analyzer-0.1.2}/PKG-INFO +1 -1
- {type_analyzer-0.1.0 → type_analyzer-0.1.2}/pyproject.toml +1 -1
- {type_analyzer-0.1.0 → type_analyzer-0.1.2}/type_analyzer/_core/matching_types.py +9 -5
- {type_analyzer-0.1.0 → type_analyzer-0.1.2}/.gitignore +0 -0
- {type_analyzer-0.1.0 → type_analyzer-0.1.2}/LICENSE +0 -0
- {type_analyzer-0.1.0 → type_analyzer-0.1.2}/README.md +0 -0
- {type_analyzer-0.1.0 → type_analyzer-0.1.2}/type_analyzer/__init__.py +0 -0
- {type_analyzer-0.1.0 → type_analyzer-0.1.2}/type_analyzer/_core/__init__.py +0 -0
- {type_analyzer-0.1.0 → type_analyzer-0.1.2}/type_analyzer/py.typed +0 -0
|
@@ -21,12 +21,15 @@ class MatchingTypesConfig:
|
|
|
21
21
|
with_type_alias_value: bool = field(default=False)
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
_empty_config = MatchingTypesConfig()
|
|
25
|
+
|
|
26
|
+
|
|
24
27
|
def iter_matching_types(
|
|
25
28
|
type_hint: Any,
|
|
26
29
|
/,
|
|
27
30
|
config: MatchingTypesConfig | None = None,
|
|
28
31
|
) -> Iterator[Any]:
|
|
29
|
-
config = config or
|
|
32
|
+
config = config or _empty_config
|
|
30
33
|
type_hints = (type_hint,)
|
|
31
34
|
return _iter_matching_types(type_hints, config)
|
|
32
35
|
|
|
@@ -76,7 +79,7 @@ def _iter_matching_types(
|
|
|
76
79
|
continue
|
|
77
80
|
|
|
78
81
|
if _is_type_var(type_hint):
|
|
79
|
-
yield params
|
|
82
|
+
yield params.get(type_hint, type_hint)
|
|
80
83
|
continue
|
|
81
84
|
|
|
82
85
|
origin = get_origin(type_hint)
|
|
@@ -92,10 +95,11 @@ def _iter_matching_types(
|
|
|
92
95
|
yield type_hint
|
|
93
96
|
|
|
94
97
|
else:
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
args = tuple(
|
|
99
|
+
next(_iter_matching_types((arg,), _empty_config, params))
|
|
100
|
+
for arg in get_args(type_hint)
|
|
97
101
|
)
|
|
98
|
-
yield origin[*
|
|
102
|
+
yield origin[*args]
|
|
99
103
|
|
|
100
104
|
if config.with_origin:
|
|
101
105
|
yield origin
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|