No types in "Paramters" list when using Python type annotation
5 views
Skip to first unread message
c.b...@posteo.jp
unread,
Jun 29, 2023, 11:32:53 AM6/29/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Sphinx users
Hello,
in the past my python docstrings looked like this.
def foobar(val):
"""
Args:
val (str): A value.
"""
The resulting HTML output looked OK to me. The "str" type is shown in
the "Paramters::" list.
Today I tried type annotation and removed the "str" from the docstring.
def foobar(val: str):
"""
Args:
val: A value.
"""
This results in an HTML output using "str" in the functions signature
"foobar(val: str)" but not in the "Paramters::" list.
Is it possible to modify this behavior and also stick to type
annotations?