Skip to content

Commit

Permalink
Ignore return type hint (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelldls authored Dec 3, 2024
1 parent 7d602ce commit ddd6b68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/fastcs/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ def _extract_options_model(controller_class: type[Controller]) -> type[BaseModel
)
elif len(args) == 2:
hints = get_type_hints(controller_class.__init__)
if "return" in hints:
del hints["return"]
if hints:
options_type = list(hints.values())[-1]
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, arg):


class IsHinted(Controller):
def __init__(self, arg: SomeConfig):
def __init__(self, arg: SomeConfig) -> None:
super().__init__()


Expand Down

0 comments on commit ddd6b68

Please sign in to comment.