Skip to content

Instantly share code, notes, and snippets.

@LouisdeBruijn
Last active June 14, 2021 19:52
Show Gist options
  • Save LouisdeBruijn/5532fa944ac675b74ad8aeb6d7fd7e74 to your computer and use it in GitHub Desktop.
Save LouisdeBruijn/5532fa944ac675b74ad8aeb6d7fd7e74 to your computer and use it in GitHub Desktop.
from automate import docstring_from_type_hints
function_argument_type_hints = get_type_hints(docstring_from_type_hints)
function_return_argument_hint = type_hints.pop("return", None)
print(function_argument_type_hints)
>>> {'repo_dir': <class 'pathlib.Path'>, 'overwrite_script': <class 'bool'>, 'test': <class 'bool'>, 'return': <class 'str'>}
print(function_return_argument_hint)
>>> <class 'str'>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment