diff --git a/solvers/python/src/aoc/tooling/map.py b/solvers/python/src/aoc/tooling/map.py index e2784ab..906c0f2 100644 --- a/solvers/python/src/aoc/tooling/map.py +++ b/solvers/python/src/aoc/tooling/map.py @@ -163,21 +163,45 @@ def iter_data_by_columns( @overload def iter_data( - self, *, direction: IterDirection + self, *, direction: Literal[IterDirection.Rows] = IterDirection.Rows + ) -> Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]]: ... + @overload + def iter_data( + self, *, direction: Literal[IterDirection.Columns] ) -> Iterable[tuple[X, Iterable[tuple[Y, Map2dDataType]]]]: ... @overload def iter_data( - self, *, direction: Literal[IterDirection.Rows] = IterDirection.Rows + self, *, direction: IterDirection + ) -> ( + Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]] + | Iterable[tuple[X, Iterable[tuple[Y, Map2dDataType]]]] + ): ... + @overload + def iter_data( + self, + first_y: Y, + first_x: X, + *, + direction: Literal[IterDirection.Rows] = IterDirection.Rows, ) -> Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]]: ... @overload def iter_data( - self, first_y: Y, first_x: X, *, direction: IterDirection + self, first_y: Y, first_x: X, *, direction: Literal[IterDirection.Columns] ) -> Iterable[tuple[X, Iterable[tuple[Y, Map2dDataType]]]]: ... @overload + def iter_data( + self, first_y: Y, first_x: X, *, direction: IterDirection + ) -> ( + Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]] + | Iterable[tuple[X, Iterable[tuple[Y, Map2dDataType]]]] + ): ... + @overload def iter_data( self, first_y: Y, first_x: X, + last_y: Y, + last_x: X, *, direction: Literal[IterDirection.Rows] = IterDirection.Rows, ) -> Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]]: ... @@ -189,7 +213,7 @@ def iter_data( last_y: Y, last_x: X, *, - direction: IterDirection, + direction: Literal[IterDirection.Columns], ) -> Iterable[tuple[X, Iterable[tuple[Y, Map2dDataType]]]]: ... @overload def iter_data( @@ -199,8 +223,11 @@ def iter_data( last_y: Y, last_x: X, *, - direction: Literal[IterDirection.Rows] = IterDirection.Rows, - ) -> Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]]: ... + direction: IterDirection, + ) -> ( + Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]] + | Iterable[tuple[X, Iterable[tuple[Y, Map2dDataType]]]] + ): ... def iter_data( self,