From 7157ce71ee4c117a7204cd3d8f779cf8bf3530f9 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 24 Jul 2026 22:03:00 +0200 Subject: [PATCH] docs: avoid mutable default argument in print_row --- docs/compiles_table.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/compiles_table.py b/docs/compiles_table.py index 2f0bb1136b..e593edcd4e 100755 --- a/docs/compiles_table.py +++ b/docs/compiles_table.py @@ -216,8 +216,8 @@ def merge_tables(old, new): def render_md(fd, table, headings: str, row_headings: Target): - def print_row(lst, lens=[]): - lens = lens + [0] * (len(lst) - len(lens)) + def print_row(lst, lens=None): + lens = (lens or []) + [0] * (len(lst) - len(lens or [])) for e, lmd in zip(lst, lens): fmt = "|{}" if lmd == 0 else "|{:>%s}" % len(header[0]) fd.write(fmt.format(e))