You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type annotations that use typing.Optional are incorrectly documented when showing help.
Example 1
fromtypingimportOptionalimportfiredefmain(arg: Optional[str] ='something'):
"""Do something with arg."""if__name__=='__main__':
fire.Fire(main)
The corresponding help output is:
INFO: Showing help with the command 'firetest.py -- --help'.
NAME
firetest.py - Do something with arg.
SYNOPSIS
firetest.py <flags>
DESCRIPTION
Do something with arg.
FLAGS
-a, --arg=ARG
Type: Optional
Default: 'something'
Here, Type: Optional is totally incorrect. It should be Optional[str]. My use of str is just an example and it can be anything.
Example 2
fromtypingimportOptionalimportfiredefmain(arg: Optional[str] =None):
"""Do something with arg."""if__name__=='__main__':
fire.Fire(main)
The corresponding help output is:
INFO: Showing help with the command 'firetest.py -- --help'.
NAME
firetest.py - Do something with arg.
SYNOPSIS
firetest.py <flags>
DESCRIPTION
Do something with arg.
FLAGS
-a, --arg=ARG
Type: Optional[Optional]
Default: None
Here, Type: Optional[Optional] is even more incorrect. It should be Optional[str]. My use of str is just an example and it can be anything.
The text was updated successfully, but these errors were encountered:
Given that fire is seemingly dead and this bug really harms the displayed help, I figure it's wise to move away from fire. Any decent LLM, e.g. gpt-4o, can replace the use of fire in a module with a different package, e.g. click.
Type annotations that use
typing.Optional
are incorrectly documented when showing help.Example 1
The corresponding help output is:
Here,
Type: Optional
is totally incorrect. It should beOptional[str]
. My use ofstr
is just an example and it can be anything.Example 2
The corresponding help output is:
Here,
Type: Optional[Optional]
is even more incorrect. It should beOptional[str]
. My use ofstr
is just an example and it can be anything.The text was updated successfully, but these errors were encountered: