Skip to content

Commit

Permalink
retry test
Browse files Browse the repository at this point in the history
  • Loading branch information
ttumiel committed Oct 11, 2023
1 parent ff3c5a4 commit 4ace6fb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions chat2func/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ def instantiate_type(py_type: type, value: Any, scope: Optional[Dict[str, Any]]
if hasattr(py_type, "__origin__"):
origin = py_type.__origin__
args = getattr(py_type, "__args__", None)
print("ARGS", args, origin, py_type, value)

if origin is Union:
for arg in args:
Expand Down
1 change: 0 additions & 1 deletion tests/test_type_instantiation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def test_instantiate_simple_type():
# Test list and tuple
assert instantiate_type(List[int], ["1", "2"]) == [1, 2]
assert instantiate_type(List[str], [1, 2]) == ["1", "2"]
assert instantiate_type(List[Union[int, str]], ["1", "a"]) == [1, "a"]
assert instantiate_type(list, [1, 2]) == [1, 2]
assert instantiate_type(tuple, [1, 2]) == (1, 2)
assert instantiate_type(Tuple[int], [1, 2]) == (1, 2)
Expand Down

0 comments on commit 4ace6fb

Please sign in to comment.