tksheet 7.4.5__py3-none-any.whl → 7.4.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
tksheet/sheet.py CHANGED
@@ -9,7 +9,7 @@ from itertools import accumulate, chain, filterfalse, islice, product, repeat
9
9
  from operator import attrgetter
10
10
  from timeit import default_timer
11
11
  from tkinter import ttk
12
- from typing import Literal
12
+ from typing import Any, Literal
13
13
 
14
14
  from .column_headers import ColumnHeaders
15
15
  from .constants import (
@@ -77,7 +77,7 @@ from .themes import (
77
77
  theme_light_blue,
78
78
  theme_light_green,
79
79
  )
80
- from .tksheet_types import AnyIter, CellPropertyKey, CreateSpanTypes
80
+ from .tksheet_types import AnyIter, Binding, CellPropertyKey, CreateSpanTypes, ExtraBinding
81
81
  from .top_left_rectangle import TopLeftRectangle
82
82
 
83
83
 
@@ -94,14 +94,14 @@ class Sheet(tk.Frame):
94
94
  show_y_scrollbar: bool = True,
95
95
  width: int | None = None,
96
96
  height: int | None = None,
97
- headers: None | list[object] = None,
98
- header: None | list[object] = None,
99
- row_index: None | list[object] = None,
100
- index: None | list[object] = None,
97
+ headers: None | list[Any] = None,
98
+ header: None | list[Any] = None,
99
+ row_index: None | list[Any] = None,
100
+ index: None | list[Any] = None,
101
101
  default_header: Literal["letters", "numbers", "both"] | None = "letters",
102
102
  default_row_index: Literal["letters", "numbers", "both"] | None = "numbers",
103
- data_reference: None | Sequence[Sequence[object]] = None,
104
- data: None | Sequence[Sequence[object]] = None,
103
+ data_reference: None | Sequence[Sequence[Any]] = None,
104
+ data: None | Sequence[Sequence[Any]] = None,
105
105
  # either (start row, end row, "rows"), (start column, end column, "rows") or
106
106
  # (cells start row, cells start column, cells end row, cells end column, "cells") # noqa: E501
107
107
  startup_select: tuple[int, int, str] | tuple[int, int, int, int, str] = None,
@@ -531,7 +531,7 @@ class Sheet(tk.Frame):
531
531
 
532
532
  def set_header_data(
533
533
  self,
534
- value: object,
534
+ value: Any,
535
535
  c: int | None | AnyIter[int] = None,
536
536
  redraw: bool = True,
537
537
  ) -> Sheet:
@@ -550,12 +550,12 @@ class Sheet(tk.Frame):
550
550
 
551
551
  def headers(
552
552
  self,
553
- newheaders: object = None,
553
+ newheaders: Any = None,
554
554
  index: None | int = None,
555
555
  reset_col_positions: bool = False,
556
556
  show_headers_if_not_sheet: bool = True,
557
557
  redraw: bool = True,
558
- ) -> object:
558
+ ) -> Any:
559
559
  self.set_refresh_timer(redraw)
560
560
  return self.MT.headers(
561
561
  newheaders,
@@ -567,7 +567,7 @@ class Sheet(tk.Frame):
567
567
 
568
568
  def set_index_data(
569
569
  self,
570
- value: object,
570
+ value: Any,
571
571
  r: int | None | AnyIter[int] = None,
572
572
  redraw: bool = True,
573
573
  ) -> Sheet:
@@ -586,12 +586,12 @@ class Sheet(tk.Frame):
586
586
 
587
587
  def row_index(
588
588
  self,
589
- newindex: object = None,
589
+ newindex: Any = None,
590
590
  index: None | int = None,
591
591
  reset_row_positions: bool = False,
592
592
  show_index_if_not_sheet: bool = True,
593
593
  redraw: bool = True,
594
- ) -> object:
594
+ ) -> Any:
595
595
  self.set_refresh_timer(redraw)
596
596
  return self.MT.row_index(
597
597
  newindex,
@@ -603,7 +603,7 @@ class Sheet(tk.Frame):
603
603
 
604
604
  # Bindings and Functionality
605
605
 
606
- def enable_bindings(self, *bindings: str) -> Sheet:
606
+ def enable_bindings(self, *bindings: Binding) -> Sheet:
607
607
  """
608
608
  List of available bindings:
609
609
  - "all"
@@ -653,7 +653,7 @@ class Sheet(tk.Frame):
653
653
  self.MT.enable_bindings(bindings)
654
654
  return self
655
655
 
656
- def disable_bindings(self, *bindings: str) -> Sheet:
656
+ def disable_bindings(self, *bindings: Binding) -> Sheet:
657
657
  """
658
658
  List of available bindings:
659
659
  - "all"
@@ -700,7 +700,7 @@ class Sheet(tk.Frame):
700
700
 
701
701
  def extra_bindings(
702
702
  self,
703
- bindings: str | list | tuple | None = None,
703
+ bindings: ExtraBinding | Sequence[ExtraBinding] | None = None,
704
704
  func: Callable | None = None,
705
705
  ) -> Sheet:
706
706
  """
@@ -1260,27 +1260,25 @@ class Sheet(tk.Frame):
1260
1260
  canvas.basic_bindings(enable)
1261
1261
  return self
1262
1262
 
1263
- def cut(self, event: object = None, validation: bool = True) -> None | EventDataDict:
1263
+ def cut(self, event: Any = None, validation: bool = True) -> None | EventDataDict:
1264
1264
  return self.MT.ctrl_x(event, validation)
1265
1265
 
1266
- def copy(self, event: object = None) -> None | EventDataDict:
1266
+ def copy(self, event: Any = None) -> None | EventDataDict:
1267
1267
  return self.MT.ctrl_c(event)
1268
1268
 
1269
- def paste(self, event: object = None, validation: bool = True) -> None | EventDataDict:
1269
+ def paste(self, event: Any = None, validation: bool = True) -> None | EventDataDict:
1270
1270
  return self.MT.ctrl_v(event, validation)
1271
1271
 
1272
- def delete(self, event: object = None, validation: bool = True) -> None | EventDataDict:
1272
+ def delete(self, event: Any = None, validation: bool = True) -> None | EventDataDict:
1273
1273
  return self.MT.delete_key(event, validation)
1274
1274
 
1275
- def undo(self, event: object = None) -> None | EventDataDict:
1275
+ def undo(self, event: Any = None) -> None | EventDataDict:
1276
1276
  return self.MT.undo(event)
1277
1277
 
1278
- def redo(self, event: object = None) -> None | EventDataDict:
1278
+ def redo(self, event: Any = None) -> None | EventDataDict:
1279
1279
  return self.MT.redo(event)
1280
1280
 
1281
- def has_focus(
1282
- self,
1283
- ) -> bool:
1281
+ def has_focus(self) -> bool:
1284
1282
  """
1285
1283
  Check if any Sheet widgets have focus
1286
1284
  Includes child widgets such as scroll bars
@@ -1340,10 +1338,10 @@ class Sheet(tk.Frame):
1340
1338
  hdisp: bool = True,
1341
1339
  transposed: bool = False,
1342
1340
  ndim: int = 0,
1343
- convert: object = None,
1341
+ convert: Any = None,
1344
1342
  undo: bool = True,
1345
1343
  emit_event: bool = False,
1346
- widget: object = None,
1344
+ widget: Any = None,
1347
1345
  expand: None | str = None,
1348
1346
  formatter_options: dict | None = None,
1349
1347
  **kwargs,
@@ -1386,10 +1384,7 @@ class Sheet(tk.Frame):
1386
1384
 
1387
1385
  # Named Spans
1388
1386
 
1389
- def named_span(
1390
- self,
1391
- span: Span,
1392
- ) -> Span:
1387
+ def named_span(self, span: Span) -> Span:
1393
1388
  if span.name in self.MT.named_spans:
1394
1389
  raise ValueError(f"Span '{span.name}' already exists.")
1395
1390
  if not span.name:
@@ -1453,7 +1448,7 @@ class Sheet(tk.Frame):
1453
1448
  del self.MT.named_spans[name]
1454
1449
  return self
1455
1450
 
1456
- def set_named_spans(self, named_spans: None | dict = None) -> Sheet:
1451
+ def set_named_spans(self, named_spans: None | dict[str, Span] = None) -> Sheet:
1457
1452
  if named_spans is None:
1458
1453
  for name in self.MT.named_spans:
1459
1454
  self.del_named_span(name)
@@ -1461,10 +1456,10 @@ class Sheet(tk.Frame):
1461
1456
  self.MT.named_spans = named_spans
1462
1457
  return self
1463
1458
 
1464
- def get_named_span(self, name: str) -> dict:
1459
+ def get_named_span(self, name: str) -> dict[str, Span]:
1465
1460
  return self.MT.named_spans[name]
1466
1461
 
1467
- def get_named_spans(self) -> dict:
1462
+ def get_named_spans(self) -> dict[str, Span]:
1468
1463
  return self.MT.named_spans
1469
1464
 
1470
1465
  # Getting Sheet Data
@@ -1475,10 +1470,7 @@ class Sheet(tk.Frame):
1475
1470
  ) -> Span:
1476
1471
  return self.span_from_key(*key)
1477
1472
 
1478
- def span_from_key(
1479
- self,
1480
- *key: CreateSpanTypes,
1481
- ) -> None | Span:
1473
+ def span_from_key(self, *key: CreateSpanTypes) -> None | Span:
1482
1474
  if not key:
1483
1475
  key = (None, None, None, None)
1484
1476
  span = key_to_span(key if len(key) != 1 else key[0], self.MT.named_spans, self)
@@ -1493,10 +1485,7 @@ class Sheet(tk.Frame):
1493
1485
  totalcols=self.MT.total_data_cols,
1494
1486
  )
1495
1487
 
1496
- def get_data(
1497
- self,
1498
- *key: CreateSpanTypes,
1499
- ) -> object:
1488
+ def get_data(self, *key: CreateSpanTypes) -> Any:
1500
1489
  """
1501
1490
  e.g. retrieves entire table as pandas dataframe
1502
1491
  sheet["A1"].expand().options(pandas.DataFrame).data
@@ -1637,20 +1626,20 @@ class Sheet(tk.Frame):
1637
1626
  c: int,
1638
1627
  r_ops: bool = True,
1639
1628
  c_ops: bool = True,
1640
- ) -> object:
1629
+ ) -> Any:
1641
1630
  return self.MT.get_value_for_empty_cell(r, c, r_ops, c_ops)
1642
1631
 
1643
1632
  @property
1644
- def data(self):
1633
+ def data(self) -> Sequence[Sequence[Any]]:
1645
1634
  return self.MT.data
1646
1635
 
1647
- def __iter__(self) -> Iterator[list[object] | tuple[object]]:
1636
+ def __iter__(self) -> Iterator[list[Any] | tuple[Any]]:
1648
1637
  return self.MT.data.__iter__()
1649
1638
 
1650
- def __reversed__(self) -> Iterator[list[object] | tuple[object]]:
1639
+ def __reversed__(self) -> Iterator[list[Any] | tuple[Any]]:
1651
1640
  return reversed(self.MT.data)
1652
1641
 
1653
- def __contains__(self, key: object) -> bool:
1642
+ def __contains__(self, key: Any) -> bool:
1654
1643
  if isinstance(key, (list, tuple)):
1655
1644
  return key in self.MT.data
1656
1645
  return any(key in row for row in self.MT.data)
@@ -1722,7 +1711,7 @@ class Sheet(tk.Frame):
1722
1711
  reset_highlights: bool = False,
1723
1712
  keep_formatting: bool = True,
1724
1713
  delete_options: bool = False,
1725
- ) -> object:
1714
+ ) -> Any:
1726
1715
  if data is None:
1727
1716
  data = []
1728
1717
  if verify and (not isinstance(data, list) or not all(isinstance(row, list) for row in data)):
@@ -1741,7 +1730,7 @@ class Sheet(tk.Frame):
1741
1730
  )
1742
1731
 
1743
1732
  @data.setter
1744
- def data(self, value: list[list[object]]) -> None:
1733
+ def data(self, value: list[list[Any]]) -> None:
1745
1734
  self.data_reference(value)
1746
1735
 
1747
1736
  def new_tksheet_event(self) -> EventDataDict:
@@ -1755,7 +1744,7 @@ class Sheet(tk.Frame):
1755
1744
  def set_data(
1756
1745
  self,
1757
1746
  *key: CreateSpanTypes,
1758
- data: object = None,
1747
+ data: Any = None,
1759
1748
  undo: bool | None = None,
1760
1749
  emit_event: bool | None = None,
1761
1750
  redraw: bool = True,
@@ -2074,8 +2063,8 @@ class Sheet(tk.Frame):
2074
2063
  self,
2075
2064
  datarn: int,
2076
2065
  datacn: int,
2077
- value: object,
2078
- event_data: dict,
2066
+ value: Any,
2067
+ event_data: EventDataDict,
2079
2068
  fmt_kw: dict | None = None,
2080
2069
  check_readonly: bool = False,
2081
2070
  ) -> EventDataDict:
@@ -2087,8 +2076,8 @@ class Sheet(tk.Frame):
2087
2076
  def event_data_set_index_cell(
2088
2077
  self,
2089
2078
  datarn: int,
2090
- value: object,
2091
- event_data: dict,
2079
+ value: Any,
2080
+ event_data: EventDataDict,
2092
2081
  check_readonly: bool = False,
2093
2082
  ) -> EventDataDict:
2094
2083
  if self.RI.input_valid_for_cell(datarn, value, check_readonly=check_readonly):
@@ -2099,8 +2088,8 @@ class Sheet(tk.Frame):
2099
2088
  def event_data_set_header_cell(
2100
2089
  self,
2101
2090
  datacn: int,
2102
- value: object,
2103
- event_data: dict,
2091
+ value: Any,
2092
+ event_data: EventDataDict,
2104
2093
  check_readonly: bool = False,
2105
2094
  ) -> EventDataDict:
2106
2095
  if self.CH.input_valid_for_cell(datacn, value, check_readonly=check_readonly):
@@ -2110,7 +2099,7 @@ class Sheet(tk.Frame):
2110
2099
 
2111
2100
  def insert_row(
2112
2101
  self,
2113
- row: list[object] | tuple[object] | None = None,
2102
+ row: list[Any] | tuple[Any] | None = None,
2114
2103
  idx: str | int | None = None,
2115
2104
  height: int | None = None,
2116
2105
  row_index: bool = False,
@@ -2132,7 +2121,7 @@ class Sheet(tk.Frame):
2132
2121
 
2133
2122
  def insert_column(
2134
2123
  self,
2135
- column: list[object] | tuple[object] | None = None,
2124
+ column: list[Any] | tuple[Any] | None = None,
2136
2125
  idx: str | int | None = None,
2137
2126
  width: int | None = None,
2138
2127
  header: bool = False,
@@ -2154,7 +2143,7 @@ class Sheet(tk.Frame):
2154
2143
 
2155
2144
  def insert_rows(
2156
2145
  self,
2157
- rows: list[tuple[object] | list[object]] | tuple[tuple[object] | list[object]] | int = 1,
2146
+ rows: list[tuple[Any] | list[Any]] | tuple[tuple[Any] | list[Any]] | int = 1,
2158
2147
  idx: str | int | None = None,
2159
2148
  heights: list[int] | tuple[int] | None = None,
2160
2149
  row_index: bool = False,
@@ -2235,7 +2224,7 @@ class Sheet(tk.Frame):
2235
2224
 
2236
2225
  def insert_columns(
2237
2226
  self,
2238
- columns: list[tuple[object] | list[object]] | tuple[tuple[object] | list[object]] | int = 1,
2227
+ columns: list[tuple[Any] | list[Any]] | tuple[tuple[Any] | list[Any]] | int = 1,
2239
2228
  idx: str | int | None = None,
2240
2229
  widths: list[int] | tuple[int] | None = None,
2241
2230
  headers: bool = False,
@@ -2759,10 +2748,10 @@ class Sheet(tk.Frame):
2759
2748
  def dropdown(
2760
2749
  self,
2761
2750
  *key: CreateSpanTypes,
2762
- values: list[object] | None = None,
2751
+ values: list[Any] | None = None,
2763
2752
  edit_data: bool = True,
2764
- set_values: dict[tuple[int, int], object] | None = None,
2765
- set_value: object = None,
2753
+ set_values: dict[tuple[int, int], Any] | None = None,
2754
+ set_value: Any = None,
2766
2755
  state: Literal["normal", "readonly", "disabled"] = "normal",
2767
2756
  redraw: bool = True,
2768
2757
  selection_function: Callable | None = None,
@@ -3008,7 +2997,7 @@ class Sheet(tk.Frame):
3008
2997
  self,
3009
2998
  *key: CreateSpanTypes,
3010
2999
  formatter_options: dict | None = None,
3011
- formatter_class: object = None,
3000
+ formatter_class: Any = None,
3012
3001
  redraw: bool = True,
3013
3002
  **kwargs,
3014
3003
  ) -> Span:
@@ -3969,7 +3958,7 @@ class Sheet(tk.Frame):
3969
3958
 
3970
3959
  # Identifying Bound Event Mouse Position
3971
3960
 
3972
- def identify_region(self, event: object) -> Literal["table", "index", "header", "top left"]:
3961
+ def identify_region(self, event: Any) -> Literal["table", "index", "header", "top left"]:
3973
3962
  if event.widget == self.MT:
3974
3963
  return "table"
3975
3964
  elif event.widget == self.RI:
@@ -3981,7 +3970,7 @@ class Sheet(tk.Frame):
3981
3970
 
3982
3971
  def identify_row(
3983
3972
  self,
3984
- event: object,
3973
+ event: Any,
3985
3974
  exclude_index: bool = False,
3986
3975
  allow_end: bool = True,
3987
3976
  ) -> int | None:
@@ -3998,7 +3987,7 @@ class Sheet(tk.Frame):
3998
3987
 
3999
3988
  def identify_column(
4000
3989
  self,
4001
- event: object,
3990
+ event: Any,
4002
3991
  exclude_header: bool = False,
4003
3992
  allow_end: bool = True,
4004
3993
  ) -> int | None:
@@ -4015,7 +4004,7 @@ class Sheet(tk.Frame):
4015
4004
 
4016
4005
  # Scroll Positions and Cell Visibility
4017
4006
 
4018
- def sync_scroll(self, widget: object) -> Sheet:
4007
+ def sync_scroll(self, widget: Any) -> Sheet:
4019
4008
  if widget is self:
4020
4009
  return self
4021
4010
  self.MT.synced_scrolls.add(widget)
@@ -4023,7 +4012,7 @@ class Sheet(tk.Frame):
4023
4012
  widget.MT.synced_scrolls.add(self)
4024
4013
  return self
4025
4014
 
4026
- def unsync_scroll(self, widget: object = None) -> Sheet:
4015
+ def unsync_scroll(self, widget: Any = None) -> Sheet:
4027
4016
  if widget is None:
4028
4017
  for widget in self.MT.synced_scrolls:
4029
4018
  if isinstance(widget, Sheet):
@@ -4499,13 +4488,13 @@ class Sheet(tk.Frame):
4499
4488
  self.CH.text_editor.window.set_text(text)
4500
4489
  return self
4501
4490
 
4502
- def destroy_text_editor(self, event: object = None) -> Sheet:
4491
+ def destroy_text_editor(self, event: Any = None) -> Sheet:
4503
4492
  self.MT.hide_text_editor(reason=event)
4504
4493
  self.RI.hide_text_editor(reason=event)
4505
4494
  self.CH.hide_text_editor(reason=event)
4506
4495
  return self
4507
4496
 
4508
- def get_text_editor_widget(self, event: object = None) -> tk.Text | None:
4497
+ def get_text_editor_widget(self, event: Any = None) -> tk.Text | None:
4509
4498
  try:
4510
4499
  return self.MT.text_editor.tktext
4511
4500
  except Exception:
@@ -4639,7 +4628,7 @@ class Sheet(tk.Frame):
4639
4628
 
4640
4629
  def event_widget_is_sheet(
4641
4630
  self,
4642
- event: object,
4631
+ event: Any,
4643
4632
  table: bool = True,
4644
4633
  index: bool = True,
4645
4634
  header: bool = True,
@@ -4993,7 +4982,7 @@ class Sheet(tk.Frame):
4993
4982
 
4994
4983
  def tree_build(
4995
4984
  self,
4996
- data: list[list[object]],
4985
+ data: list[list[Any]],
4997
4986
  iid_column: int,
4998
4987
  parent_column: int,
4999
4988
  text_column: None | int | list[str] = None,
@@ -5121,7 +5110,7 @@ class Sheet(tk.Frame):
5121
5110
  index: None | int | Literal["end"] = None,
5122
5111
  iid: None | str = None,
5123
5112
  text: None | str = None,
5124
- values: None | list[object] = None,
5113
+ values: None | list[Any] = None,
5125
5114
  create_selections: bool = False,
5126
5115
  undo: bool = True,
5127
5116
  ) -> str:
@@ -5180,7 +5169,7 @@ class Sheet(tk.Frame):
5180
5169
 
5181
5170
  def bulk_insert(
5182
5171
  self,
5183
- data: list[list[object]],
5172
+ data: list[list[Any]],
5184
5173
  parent: str = "",
5185
5174
  index: None | int | Literal["end"] = None,
5186
5175
  iid_column: int | None = None,
@@ -5249,14 +5238,6 @@ class Sheet(tk.Frame):
5249
5238
  """
5250
5239
  if item not in self.RI.tree:
5251
5240
  raise ValueError(f"Item '{item}' does not exist.")
5252
- if isinstance(iid, str):
5253
- if iid in self.RI.tree:
5254
- raise ValueError(f"Cannot rename '{iid}', it already exists.")
5255
- self.RI.tree[item].iid = iid
5256
- self.RI.tree[iid] = self.RI.tree.pop(item)
5257
- self.RI.tree_rns[iid] = self.RI.tree_rns.pop(item)
5258
- if iid in self.RI.tree_open_ids:
5259
- self.RI.tree_open_ids[iid] = self.RI.tree_open_ids.pop(item)
5260
5241
  if isinstance(text, str):
5261
5242
  self.RI.tree[item].text = text
5262
5243
  if isinstance(values, list):
@@ -5284,6 +5265,21 @@ class Sheet(tk.Frame):
5284
5265
  )
5285
5266
  else:
5286
5267
  self.RI.tree_open_ids.discard(item)
5268
+ if isinstance(iid, str):
5269
+ if iid in self.RI.tree:
5270
+ raise ValueError(f"Cannot rename '{iid}', it already exists.")
5271
+ for ciid in self.RI.tree[item].children:
5272
+ self.RI.tree[ciid].parent = iid
5273
+ if self.RI.tree[item].parent:
5274
+ parent_node = self.RI.parent_node(item)
5275
+ item_index = parent_node.children.index(item)
5276
+ parent_node.children[item_index] = iid
5277
+ self.RI.tree[item].iid = iid
5278
+ self.RI.tree[iid] = self.RI.tree.pop(item)
5279
+ self.RI.tree_rns[iid] = self.RI.tree_rns.pop(item)
5280
+ if item in self.RI.tree_open_ids:
5281
+ self.RI.tree_open_ids.discard(item)
5282
+ self.RI.tree_open_ids.add(iid)
5287
5283
  get = not (isinstance(iid, str) or isinstance(text, str) or isinstance(values, list) or isinstance(open_, bool))
5288
5284
  self.set_refresh_timer(redraw=not get and redraw)
5289
5285
  if get:
@@ -5659,7 +5655,7 @@ class Sheet(tk.Frame):
5659
5655
 
5660
5656
  # ########## OLD FUNCTIONS ##########
5661
5657
 
5662
- def get_cell_data(self, r: int, c: int, get_displayed: bool = False) -> object:
5658
+ def get_cell_data(self, r: int, c: int, get_displayed: bool = False) -> Any:
5663
5659
  return self.MT.get_cell_data(r, c, get_displayed)
5664
5660
 
5665
5661
  def get_row_data(
@@ -5669,7 +5665,7 @@ class Sheet(tk.Frame):
5669
5665
  get_index: bool = False,
5670
5666
  get_index_displayed: bool = True,
5671
5667
  only_columns: int | AnyIter[int] | None = None,
5672
- ) -> list[object]:
5668
+ ) -> list[Any]:
5673
5669
  if only_columns is not None:
5674
5670
  if isinstance(only_columns, int):
5675
5671
  only_columns = (only_columns,)
@@ -5695,7 +5691,7 @@ class Sheet(tk.Frame):
5695
5691
  get_header: bool = False,
5696
5692
  get_header_displayed: bool = True,
5697
5693
  only_rows: int | AnyIter[int] | None = None,
5698
- ) -> list[object]:
5694
+ ) -> list[Any]:
5699
5695
  if only_rows is not None:
5700
5696
  if isinstance(only_rows, int):
5701
5697
  only_rows = (only_rows,)
@@ -5715,7 +5711,7 @@ class Sheet(tk.Frame):
5715
5711
  get_index_displayed: bool = True,
5716
5712
  only_rows: AnyIter[int] | int | None = None,
5717
5713
  only_columns: AnyIter[int] | int | None = None,
5718
- ) -> list[object]:
5714
+ ) -> list[Any]:
5719
5715
  if only_rows is not None:
5720
5716
  if isinstance(only_rows, int):
5721
5717
  only_rows = (only_rows,)
@@ -5764,7 +5760,7 @@ class Sheet(tk.Frame):
5764
5760
  get_header_displayed: bool = True,
5765
5761
  only_rows: int | AnyIter[int] | None = None,
5766
5762
  only_columns: int | AnyIter[int] | None = None,
5767
- ) -> Iterator[list[object]]:
5763
+ ) -> Iterator[list[Any]]:
5768
5764
  if only_rows is not None:
5769
5765
  if isinstance(only_rows, int):
5770
5766
  only_rows = (only_rows,)
@@ -5804,7 +5800,7 @@ class Sheet(tk.Frame):
5804
5800
  reset_col_positions: bool = True,
5805
5801
  reset_row_positions: bool = True,
5806
5802
  redraw: bool = True,
5807
- ) -> object:
5803
+ ) -> Any:
5808
5804
  self.set_refresh_timer(redraw)
5809
5805
  return self.MT.data_reference(newdataref, reset_col_positions, reset_row_positions)
5810
5806
 
@@ -5812,7 +5808,7 @@ class Sheet(tk.Frame):
5812
5808
  self,
5813
5809
  r: int,
5814
5810
  c: int,
5815
- value: object = "",
5811
+ value: Any = "",
5816
5812
  redraw: bool = True,
5817
5813
  keep_formatting: bool = True,
5818
5814
  ) -> Sheet:
@@ -5824,7 +5820,7 @@ class Sheet(tk.Frame):
5824
5820
  def set_row_data(
5825
5821
  self,
5826
5822
  r: int,
5827
- values: Sequence[object] = [],
5823
+ values: Sequence[Any] = [],
5828
5824
  add_columns: bool = True,
5829
5825
  redraw: bool = True,
5830
5826
  keep_formatting: bool = True,
@@ -5856,7 +5852,7 @@ class Sheet(tk.Frame):
5856
5852
  def set_column_data(
5857
5853
  self,
5858
5854
  c: int,
5859
- values: Sequence[object] = [],
5855
+ values: Sequence[Any] = [],
5860
5856
  add_rows: bool = True,
5861
5857
  redraw: bool = True,
5862
5858
  keep_formatting: bool = True,
@@ -6577,7 +6573,7 @@ class Sheet(tk.Frame):
6577
6573
  self._create_dropdown(r, c, v, d)
6578
6574
  return self.set_refresh_timer(kwargs["redraw"])
6579
6575
 
6580
- def _create_dropdown(self, r: int, c: int, v: object, d: dict) -> None:
6576
+ def _create_dropdown(self, r: int, c: int, v: Any, d: dict) -> None:
6581
6577
  self.del_cell_options_dropdown_and_checkbox(r, c)
6582
6578
  add_to_options(self.MT.cell_options, (r, c), "dropdown", d)
6583
6579
  self.MT.set_cell_data(r, c, v)
@@ -6610,7 +6606,7 @@ class Sheet(tk.Frame):
6610
6606
  self._dropdown_row(r_, v, d)
6611
6607
  return self.set_refresh_timer(kwargs["redraw"])
6612
6608
 
6613
- def _dropdown_row(self, r: int, v: object, d: dict) -> None:
6609
+ def _dropdown_row(self, r: int, v: Any, d: dict) -> None:
6614
6610
  self.del_row_options_dropdown_and_checkbox(r)
6615
6611
  add_to_options(self.MT.row_options, r, "dropdown", d)
6616
6612
  for c in range(self.MT.total_data_cols()):
@@ -6635,7 +6631,7 @@ class Sheet(tk.Frame):
6635
6631
  self._dropdown_column(c_, v, d)
6636
6632
  return self.set_refresh_timer(kwargs["redraw"])
6637
6633
 
6638
- def _dropdown_column(self, c: int, v: object, d: dict) -> None:
6634
+ def _dropdown_column(self, c: int, v: Any, d: dict) -> None:
6639
6635
  self.del_column_options_dropdown_and_checkbox(c)
6640
6636
  add_to_options(self.MT.col_options, c, "dropdown", d)
6641
6637
  for r in range(self.MT.total_data_rows()):
@@ -6660,7 +6656,7 @@ class Sheet(tk.Frame):
6660
6656
  self._create_header_dropdown(c_, v, d)
6661
6657
  return self.set_refresh_timer(kwargs["redraw"])
6662
6658
 
6663
- def _create_header_dropdown(self, c: int, v: object, d: dict) -> None:
6659
+ def _create_header_dropdown(self, c: int, v: Any, d: dict) -> None:
6664
6660
  self.del_header_cell_options_dropdown_and_checkbox(c)
6665
6661
  add_to_options(self.CH.cell_options, c, "dropdown", d)
6666
6662
  self.CH.set_cell_data(c, v)
@@ -6684,7 +6680,7 @@ class Sheet(tk.Frame):
6684
6680
  self._create_index_dropdown(r_, v, d)
6685
6681
  return self.set_refresh_timer(kwargs["redraw"])
6686
6682
 
6687
- def _create_index_dropdown(self, r: int, v: object, d: dict) -> None:
6683
+ def _create_index_dropdown(self, r: int, v: Any, d: dict) -> None:
6688
6684
  self.del_index_cell_options_dropdown_and_checkbox(r)
6689
6685
  add_to_options(self.RI.cell_options, r, "dropdown", d)
6690
6686
  self.RI.set_cell_data(r, v)
@@ -6793,8 +6789,8 @@ class Sheet(tk.Frame):
6793
6789
  r: int = 0,
6794
6790
  c: int = 0,
6795
6791
  set_existing_dropdown: bool = False,
6796
- values: list[object] | None = None,
6797
- set_value: object = None,
6792
+ values: list[Any] | None = None,
6793
+ set_value: Any = None,
6798
6794
  ) -> Sheet:
6799
6795
  if values is None:
6800
6796
  values = []
@@ -6820,8 +6816,8 @@ class Sheet(tk.Frame):
6820
6816
  self,
6821
6817
  c: int = 0,
6822
6818
  set_existing_dropdown: bool = False,
6823
- values: list[object] | None = None,
6824
- set_value: object = None,
6819
+ values: list[Any] | None = None,
6820
+ set_value: Any = None,
6825
6821
  ) -> Sheet:
6826
6822
  if values is None:
6827
6823
  values = []
@@ -6846,8 +6842,8 @@ class Sheet(tk.Frame):
6846
6842
  self,
6847
6843
  r: int = 0,
6848
6844
  set_existing_dropdown: bool = False,
6849
- values: list[object] | None = None,
6850
- set_value: object = None,
6845
+ values: list[Any] | None = None,
6846
+ set_value: Any = None,
6851
6847
  ) -> Sheet:
6852
6848
  if values is None:
6853
6849
  values = []
@@ -6923,15 +6919,15 @@ class Sheet(tk.Frame):
6923
6919
  kwargs["modified_function"] = modified_function
6924
6920
  return kwargs
6925
6921
 
6926
- def get_dropdown_value(self, r: int = 0, c: int = 0) -> object:
6922
+ def get_dropdown_value(self, r: int = 0, c: int = 0) -> Any:
6927
6923
  if self.MT.get_cell_kwargs(r, c, key="dropdown"):
6928
6924
  return self.get_cell_data(r, c)
6929
6925
 
6930
- def get_header_dropdown_value(self, c: int = 0) -> object:
6926
+ def get_header_dropdown_value(self, c: int = 0) -> Any:
6931
6927
  if self.CH.get_cell_kwargs(c, key="dropdown"):
6932
6928
  return self.MT._headers[c]
6933
6929
 
6934
- def get_index_dropdown_value(self, r: int = 0) -> object:
6930
+ def get_index_dropdown_value(self, r: int = 0) -> Any:
6935
6931
  if self.RI.get_cell_kwargs(r, key="dropdown"):
6936
6932
  return self.MT._row_index[r]
6937
6933
 
@@ -6940,7 +6936,7 @@ class Sheet(tk.Frame):
6940
6936
  r: int | Literal["all"],
6941
6937
  c: int | Literal["all"],
6942
6938
  formatter_options: dict | None = None,
6943
- formatter_class: object = None,
6939
+ formatter_class: Any = None,
6944
6940
  redraw: bool = True,
6945
6941
  **kwargs,
6946
6942
  ) -> Sheet:
@@ -6993,7 +6989,7 @@ class Sheet(tk.Frame):
6993
6989
  self,
6994
6990
  r: AnyIter[int] | int | Literal["all"],
6995
6991
  formatter_options: dict | None = None,
6996
- formatter_class: object = None,
6992
+ formatter_class: Any = None,
6997
6993
  redraw: bool = True,
6998
6994
  **kwargs,
6999
6995
  ) -> Sheet:
@@ -7037,7 +7033,7 @@ class Sheet(tk.Frame):
7037
7033
  self,
7038
7034
  c: AnyIter[int] | int | Literal["all"],
7039
7035
  formatter_options: dict | None = None,
7040
- formatter_class: object = None,
7036
+ formatter_class: Any = None,
7041
7037
  redraw: bool = True,
7042
7038
  **kwargs,
7043
7039
  ) -> Sheet:
@@ -7094,7 +7090,7 @@ class Dropdown(Sheet):
7094
7090
  height: int | None = None,
7095
7091
  font: None | tuple[str, int, str] = None,
7096
7092
  outline_thickness: int = 2,
7097
- values: list[object] | None = None,
7093
+ values: list[Any] | None = None,
7098
7094
  close_dropdown_window: Callable | None = None,
7099
7095
  search_function: Callable = dropdown_search_function,
7100
7096
  modified_function: None | Callable = None,
@@ -7171,7 +7167,7 @@ class Dropdown(Sheet):
7171
7167
  ops: DotDict,
7172
7168
  outline_color: str,
7173
7169
  align: str,
7174
- values: list[object] | None = None,
7170
+ values: list[Any] | None = None,
7175
7171
  search_function: Callable = dropdown_search_function,
7176
7172
  modified_function: None | Callable = None,
7177
7173
  ) -> None:
@@ -7201,7 +7197,7 @@ class Dropdown(Sheet):
7201
7197
  )
7202
7198
  self.values(values, width=width - self.yscroll.winfo_width() - 4)
7203
7199
 
7204
- def arrowkey_UP(self, event: object = None) -> None:
7200
+ def arrowkey_UP(self, event: Any = None) -> None:
7205
7201
  if self.row > 0:
7206
7202
  self.row -= 1
7207
7203
  else:
@@ -7209,13 +7205,13 @@ class Dropdown(Sheet):
7209
7205
  self.see(self.row, 0, redraw=False)
7210
7206
  self.select_row(self.row)
7211
7207
 
7212
- def arrowkey_DOWN(self, event: object = None) -> None:
7208
+ def arrowkey_DOWN(self, event: Any = None) -> None:
7213
7209
  if len(self.MT.data) - 1 > self.row:
7214
7210
  self.row += 1
7215
7211
  self.see(self.row, 0, redraw=False)
7216
7212
  self.select_row(self.row)
7217
7213
 
7218
- def search_and_see(self, event: object = None) -> str:
7214
+ def search_and_see(self, event: Any = None) -> str:
7219
7215
  if self.search_function is not None:
7220
7216
  rn = self.search_function(search_for=rf"{event['value']}", data=(r[0] for r in self.MT.data))
7221
7217
  if isinstance(rn, int):
@@ -7224,7 +7220,7 @@ class Dropdown(Sheet):
7224
7220
  self.select_row(self.row)
7225
7221
  return self.MT.data[rn][0]
7226
7222
 
7227
- def mouse_motion(self, event: object) -> None:
7223
+ def mouse_motion(self, event: Any) -> None:
7228
7224
  row = self.identify_row(event, exclude_index=True, allow_end=False)
7229
7225
  if row is not None and row != self.row:
7230
7226
  self.row = row
@@ -7235,7 +7231,7 @@ class Dropdown(Sheet):
7235
7231
  if rows:
7236
7232
  self.select_row(next(iter(rows)))
7237
7233
 
7238
- def b1(self, event: object = None) -> None:
7234
+ def b1(self, event: Any = None) -> None:
7239
7235
  if event is None:
7240
7236
  row = None
7241
7237
  elif event.keysym == "Return":
@@ -7266,7 +7262,7 @@ class Dropdown(Sheet):
7266
7262
 
7267
7263
  def values(
7268
7264
  self,
7269
- values: list[object] | None = None,
7265
+ values: list[Any] | None = None,
7270
7266
  redraw: bool = True,
7271
7267
  width: int | None = None,
7272
7268
  ) -> None: