This commit is contained in:
Kovid Goyal 2026-09-06 06:47:26 +05:30
parent f3fdc21850
commit cb1b153526
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -56,8 +56,7 @@ def generate_class(defn: Definition, loc: str) -> tuple[str, str]:
def option_type_data(option: Option | MultiOption) -> tuple[Callable[[Any], Any], str]:
func = option.parser_func
if func.__module__ == 'builtins':
assert isinstance(func, types.FunctionType)
return func, func.__name__
return getattr(func, '__name__')
th = get_type_hints(func)
rettype = th['return']
typ = option_type_as_str(rettype)