Skip to content
Merged
Changes from 1 commit
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
1 change: 0 additions & 1 deletion docs/api/gen_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ def _is_self_arg(arg: ast.arg) -> bool:
arg_list.append("*")
for i, kwonlyarg in enumerate(fn_node.args.kwonlyargs):
kwdefault = fn_node.args.kw_defaults[i]
assert kwdefault is not None
default_value_str = _gen_default_value_string(kwdefault)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不是直接 remove assert 就行的

if kwdefault is None:
    arg_list.append(kwonlyarg.arg)
else:
    default_value_str = _gen_default_value_string(kwdefault)
    arg_list.append(f"{kwonlyarg.arg}={default_value_str}")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改好了,前面看太急了,不好意思喵

arg_list.append(f"{kwonlyarg.arg}={default_value_str}")
# kwarg
Expand Down