mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add some missing return types
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user