Skip to content

Commit

Permalink
Merge pull request Textualize#3624 from pawamoy/patch-1
Browse files Browse the repository at this point in the history
Document CellKey being a RowKey, ColumnKey tuple
  • Loading branch information
davep authored Nov 2, 2023
2 parents da70d83 + fcd664e commit 3bb8c46
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/textual/widgets/_data_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,16 @@ class ColumnKey(StringKey):
class CellKey(NamedTuple):
"""A unique identifier for a cell in the DataTable.
A cell key is a `(row_key, column_key)` tuple.
Even if the cell changes
visual location (i.e. moves to a different coordinate in the table), this key
can still be used to retrieve it, regardless of where it currently is."""

row_key: RowKey
"""The key of this cell's row."""
column_key: ColumnKey
"""The key of this cell's column."""

def __rich_repr__(self):
yield "row_key", self.row_key
Expand Down

0 comments on commit 3bb8c46

Please sign in to comment.