From afcafbba0ae6dfd4d48b523c6c97ee6473b4f59b Mon Sep 17 00:00:00 2001 From: Stefan Harmuth Date: Sun, 4 Dec 2022 10:58:17 +0100 Subject: [PATCH] set default in from_string --- tools/grid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/grid.py b/tools/grid.py index 6c5b53a..50190da 100644 --- a/tools/grid.py +++ b/tools/grid.py @@ -377,8 +377,8 @@ class Grid: ) @classmethod - def from_str(cls, grid_string: str, true_char: str = '#') -> 'Grid': - ret = cls() + def from_str(cls, grid_string: str, true_char: str = '#', default: Any = False) -> 'Grid': + ret = cls(default=default) for y, line in enumerate(grid_string.split("/")): for x, c in enumerate(line): ret.set(Coordinate(x, y), c == true_char)