docs: avoid mutable default argument in print_row

This commit is contained in:
Sylvestre Ledru committed 2026-07-25 13:50:16 +02:00
1 parent 3faaf4b9c9
commit 7157ce71ee
1 file changed
+2 -2
+2 -2
View File
@@ -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))