From 544058a39b876e80c8469e64d52041165bc73076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Wed, 1 Nov 2023 14:55:57 +0100 Subject: [PATCH 1/2] Document CellKey being a RowKey, ColumnKey tuple --- src/textual/widgets/_data_table.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/textual/widgets/_data_table.py b/src/textual/widgets/_data_table.py index 54c35a63a3..2e5ffb63ce 100644 --- a/src/textual/widgets/_data_table.py +++ b/src/textual/widgets/_data_table.py @@ -131,6 +131,8 @@ 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.""" From fcd664e8668788d70064d2ed44e8bd8377debf83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Wed, 1 Nov 2023 17:34:53 +0100 Subject: [PATCH 2/2] fixup! Document CellKey being a RowKey, ColumnKey tuple --- src/textual/widgets/_data_table.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/textual/widgets/_data_table.py b/src/textual/widgets/_data_table.py index 2e5ffb63ce..3f4aec4944 100644 --- a/src/textual/widgets/_data_table.py +++ b/src/textual/widgets/_data_table.py @@ -138,7 +138,9 @@ class CellKey(NamedTuple): 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