type-analyzer 0.1.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: type-analyzer
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Functions for introspecting Python type hints.
5
5
  Project-URL: Repository, https://github.com/100nm/type-analyzer
6
6
  Author: remimd
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "type-analyzer"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  description = "Functions for introspecting Python type hints."
5
5
  license = "MIT"
6
6
  license-files = ["LICENSE"]
@@ -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 MatchingTypesConfig()
32
+ config = config or _empty_config
30
33
  type_hints = (type_hint,)
31
34
  return _iter_matching_types(type_hints, config)
32
35
 
@@ -93,7 +96,7 @@ def _iter_matching_types(
93
96
 
94
97
  else:
95
98
  args = tuple(
96
- params.get(arg, arg) if _is_type_var(arg) else arg
99
+ next(_iter_matching_types((arg,), _empty_config, params))
97
100
  for arg in get_args(type_hint)
98
101
  )
99
102
  yield origin[*args]
File without changes
File without changes
File without changes