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 2 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
32 changes: 32 additions & 0 deletions src/ansys_sphinx_theme/type_hint_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from typing import Union


def type_hint_func(
param1: int = 1, param2: str = "test", param3: Union[int, float] = 1
) -> bool:
"""Function description.
GuillemBarroso marked this conversation as resolved.
Show resolved Hide resolved

Extended description of function. Can span multiple lines and
GuillemBarroso marked this conversation as resolved.
Show resolved Hide resolved
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 return value.
GuillemBarroso marked this conversation as resolved.
Show resolved Hide resolved

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

"""
return True