(rows: cabc.Iterable[tuple[str, str]])
| 12 | |
| 13 | |
| 14 | def measure_table(rows: cabc.Iterable[tuple[str, str]]) -> tuple[int, ...]: |
| 15 | widths: dict[int, int] = {} |
| 16 | |
| 17 | for row in rows: |
| 18 | for idx, col in enumerate(row): |
| 19 | widths[idx] = max(widths.get(idx, 0), term_len(col)) |
| 20 | |
| 21 | return tuple(y for x, y in sorted(widths.items())) |
| 22 | |
| 23 | |
| 24 | def iter_rows( |