Skip to content

Commit

Permalink
fix: tuple args parse
Browse files Browse the repository at this point in the history
  • Loading branch information
Yazawazi committed Feb 28, 2024
1 parent 3201ec2 commit 1aa5f1a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions backend/funix/decorator/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,15 +573,16 @@ def parse_function_annotation(
if (
cast_to_list_flag := function_signature.return_annotation.__class__.__name__
== "tuple"
or function_signature.return_annotation.__name__ == "tuple"
or function_signature.return_annotation.__name__ == "Tuple"
):
parsed_return_annotation_list = []
return_annotation = list(
function_signature.return_annotation
if function_signature.return_annotation.__class__.__name__
== "tuple"
else function_signature.return_annotation.__args__
)
if function_signature.return_annotation.__class__.__name__ == "tuple":
return_annotation = list(function_signature.return_annotation)
else:
return_annotation = list(
function_signature.return_annotation.__args__
)
for return_annotation_type in return_annotation:
return_annotation_type_name = getattr(
return_annotation_type, "__name__"
Expand Down

0 comments on commit 1aa5f1a

Please sign in to comment.