Hello, I noticed that in version 1.3, the help method converts Python objects into a JSON structure. However, the current implementation prevents the use of UnionType in action definitions, which makes the args unable to be optional.
I looked at the code, and the main reason for this is:
# type
sig_annotation = signature.parameters[arg_name].annotation
if sig_annotation is not None and sig_annotation.__name__ != "_empty":
When the argument type is a UnionType, sig_annotation does not have the __name__ attribute.
Is this a design decision?
Hello, I noticed that in version 1.3, the
helpmethod converts Python objects into a JSON structure. However, the current implementation prevents the use ofUnionTypein action definitions, which makes the args unable to be optional.I looked at the code, and the main reason for this is:
When the argument type is a
UnionType,sig_annotationdoes not have the__name__attribute.Is this a design decision?