We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 716bbc2 commit 004e65eCopy full SHA for 004e65e
fire/helptext.py
@@ -524,13 +524,9 @@ def _GetArgType(arg, spec):
524
"""
525
if arg in spec.annotations:
526
arg_type = spec.annotations[arg]
527
- try:
528
- return arg_type.__qualname__
529
- except AttributeError:
530
- # Some typing objects, such as typing.Union do not have either a __name__
531
- # or __qualname__ attribute.
532
- # repr(typing.Union[int, str]) will return ': typing.Union[int, str]'
533
- 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)
534
return ''
535
536
0 commit comments