Add some missing return types

This commit is contained in:
Dave Pearson
2022-11-10 21:38:58 +00:00
parent c18852a737
commit 2a80e1761d

View File

@@ -88,22 +88,38 @@ class Coord(NamedTuple):
column: int
def left(self) -> Coord:
"""Get coordinate to the left."""
"""Get coordinate to the left.
Returns:
Coord: The coordinate.
"""
row, column = self
return Coord(row, column - 1)
def right(self) -> Coord:
"""Get coordinate to the right."""
"""Get coordinate to the right.
Returns:
Coord: The coordinate.
"""
row, column = self
return Coord(row, column + 1)
def up(self) -> Coord:
"""Get coordinate above."""
"""Get coordinate above.
Returns:
Coord: The coordinate.
"""
row, column = self
return Coord(row - 1, column)
def down(self) -> Coord:
"""Get coordinate below."""
"""Get coordinate below.
Returns:
Coord: The coordinate.
"""
row, column = self
return Coord(row + 1, column)