From 067dc28dbdb7069713cb2af56d492267e9926dc7 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Fri, 7 Jun 2024 17:05:20 +0200 Subject: Remove trailing \n when printing PolyMatrixImpl --- polymatrix/polymatrix/impl.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/polymatrix/polymatrix/impl.py b/polymatrix/polymatrix/impl.py index ac426b7..55c9e0e 100644 --- a/polymatrix/polymatrix/impl.py +++ b/polymatrix/polymatrix/impl.py @@ -27,12 +27,12 @@ class PolyMatrixImpl(PolyMatrix): rows.append("0") columns.append(tuple(row.rjust(row_width) for row in rows)) - string = "" + row_strings = [] for r in range(nrows): column = ", ".join(columns[c][r] for c in range(ncols)) - string += f"[ {column} ]\n" + row_strings.append(f"[ {column} ]") - return string + return "\n".join(row_strings) @dataclassabc(frozen=True) -- cgit v1.2.1