Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type hint example function #137

Merged
merged 5 commits into from
Oct 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/ansys_sphinx_theme/type_hint_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Module containing an example function using type hinting."""
from typing import Union


def type_hint_func(param1: int = 1, param2: str = "test", param3: Union[int, float] = 1) -> bool:
"""Summary containing the function description.

Extended description of the function. Can span multiple lines and
provides a general overview of the function.

Parameters
----------
param1 :
Description of an integer parameter.
param2 :
Description of a string parameter.
param3 :
Parameter that can be either int or float using Union (typing).

Returns
-------
bool
Description of the returned value.

Examples
--------
>>> func(1, 'foo', 1)
True

"""
return True