Skip to content
Open
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
10 changes: 3 additions & 7 deletions fire/helptext.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,13 +524,9 @@ def _GetArgType(arg, spec):
"""
if arg in spec.annotations:
arg_type = spec.annotations[arg]
try:
return arg_type.__qualname__
except AttributeError:
# Some typing objects, such as typing.Union do not have either a __name__
# or __qualname__ attribute.
# repr(typing.Union[int, str]) will return ': typing.Union[int, str]'
return repr(arg_type)
# Use repr() to get full type representation including generic args (e.g., Optional[str])
# This fixes the bug where __qualname__ returns just "Optional" instead of "Optional[str]"
return repr(arg_type)
return ''


Expand Down