Skip to content
Closed
Changes from all commits
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
3 changes: 3 additions & 0 deletions Python/symtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,9 @@ symtable_record_directive(struct symtable *st, identifier name, _Py_SourceLocati
static int
has_kwonlydefaults(asdl_arg_seq *kwonlyargs, asdl_expr_seq *kw_defaults)
{
if (!kw_defaults) {
return 0;
}
Comment on lines +1783 to +1785
Copy link
Member

@picnixz picnixz Jun 9, 2025

Choose a reason for hiding this comment

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

I think the loop won't be executed if we pass a NULL because s->v.AsyncFunctionDef.args->kwonlyargs would have a sequence length of 0 (for the existing calls). So I think we should add an assertion instead or leave the code as is.

for (int i = 0; i < asdl_seq_LEN(kwonlyargs); i++) {
expr_ty default_ = asdl_seq_GET(kw_defaults, i);
if (default_) {
Expand Down
Loading