diff options
author | Nao Pross <np@0hm.ch> | 2024-06-07 17:05:20 +0200 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2024-06-07 17:05:20 +0200 |
commit | 067dc28dbdb7069713cb2af56d492267e9926dc7 (patch) | |
tree | 36dee56e9c73ad8165d81db829a935c725eb5b21 | |
parent | Add more __str__ methods to PolyMatrix for debugging (diff) | |
download | polymatrix-067dc28dbdb7069713cb2af56d492267e9926dc7.tar.gz polymatrix-067dc28dbdb7069713cb2af56d492267e9926dc7.zip |
Remove trailing \n when printing PolyMatrixImpl
Diffstat (limited to '')
-rw-r--r-- | polymatrix/polymatrix/impl.py | 6 |
1 files 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) |