Use lowercase tuple where possible (#6170)

This commit is contained in:
Akuli
2021-10-15 00:18:19 +00:00
committed by GitHub
parent 5f386b0575
commit 994b69ef8f
242 changed files with 1212 additions and 1224 deletions

View File

@@ -75,9 +75,9 @@ class Button(Widget):
textvariable: tkinter.Variable = ...,
underline: int = ...,
width: int | Literal[""] = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure
def invoke(self) -> Any: ...
@@ -127,9 +127,9 @@ class Checkbutton(Widget):
underline: int = ...,
variable: tkinter.Variable = ...,
width: int | Literal[""] = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure
def invoke(self) -> Any: ...
@@ -179,9 +179,9 @@ class Entry(Widget, tkinter.Entry):
validatecommand: tkinter._EntryValidateCommand = ...,
width: int = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
# config must be copy/pasted, otherwise ttk.Entry().config is mypy error (don't know why)
@overload # type: ignore
def config(
@@ -204,9 +204,9 @@ class Entry(Widget, tkinter.Entry):
validatecommand: tkinter._EntryValidateCommand = ...,
width: int = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def config(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
def bbox(self, index): ...
def identify(self, x, y): ...
def validate(self): ...
@@ -262,9 +262,9 @@ class Combobox(Entry):
values: tkinter._TkinterSequence[str] = ...,
width: int = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
# config must be copy/pasted, otherwise ttk.Combobox().config is mypy error (don't know why)
@overload # type: ignore
def config(
@@ -290,9 +290,9 @@ class Combobox(Entry):
values: tkinter._TkinterSequence[str] = ...,
width: int = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def config(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
def current(self, newindex: Any | None = ...): ...
def set(self, value): ...
@@ -327,9 +327,9 @@ class Frame(Widget):
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
width: tkinter._ScreenUnits = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure
class Label(Widget):
@@ -385,9 +385,9 @@ class Label(Widget):
underline: int = ...,
width: int | Literal[""] = ...,
wraplength: tkinter._ScreenUnits = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure
class Labelframe(Widget):
@@ -429,9 +429,9 @@ class Labelframe(Widget):
text: float | str = ...,
underline: int = ...,
width: tkinter._ScreenUnits = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure
LabelFrame = Labelframe
@@ -475,9 +475,9 @@ class Menubutton(Widget):
textvariable: tkinter.Variable = ...,
underline: int = ...,
width: int | Literal[""] = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure
class Notebook(Widget):
@@ -505,9 +505,9 @@ class Notebook(Widget):
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
width: int = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure
def add(
self,
@@ -557,9 +557,9 @@ class Panedwindow(Widget, tkinter.PanedWindow):
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
width: int = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
# config must be copy/pasted, otherwise ttk.Panedwindow().config is mypy error (don't know why)
@overload # type: ignore
def config(
@@ -571,9 +571,9 @@ class Panedwindow(Widget, tkinter.PanedWindow):
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
width: int = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def config(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
forget: Any
def insert(self, pos, child, **kw): ...
def pane(self, pane, option: Any | None = ..., **kw): ...
@@ -614,9 +614,9 @@ class Progressbar(Widget):
takefocus: tkinter._TakeFocusValue = ...,
value: float = ...,
variable: tkinter.IntVar | tkinter.DoubleVar = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure
def start(self, interval: Any | None = ...): ...
def step(self, amount: Any | None = ...): ...
@@ -663,9 +663,9 @@ class Radiobutton(Widget):
value: Any = ...,
variable: tkinter.Variable | Literal[""] = ...,
width: int | Literal[""] = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure
def invoke(self) -> Any: ...
@@ -704,9 +704,9 @@ class Scale(Widget, tkinter.Scale):
to: float = ...,
value: float = ...,
variable: tkinter.IntVar | tkinter.DoubleVar = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
# config must be copy/pasted, otherwise ttk.Scale().config is mypy error (don't know why)
@overload # type: ignore
def config(
@@ -724,9 +724,9 @@ class Scale(Widget, tkinter.Scale):
to: float = ...,
value: float = ...,
variable: tkinter.IntVar | tkinter.DoubleVar = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def config(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
def get(self, x: Any | None = ..., y: Any | None = ...): ...
class Scrollbar(Widget, tkinter.Scrollbar):
@@ -735,7 +735,7 @@ class Scrollbar(Widget, tkinter.Scrollbar):
master: tkinter.Misc | None = ...,
*,
class_: str = ...,
command: Callable[..., Tuple[float, float] | None] | str = ...,
command: Callable[..., tuple[float, float] | None] | str = ...,
cursor: tkinter._Cursor = ...,
name: str = ...,
orient: Literal["horizontal", "vertical"] = ...,
@@ -747,28 +747,28 @@ class Scrollbar(Widget, tkinter.Scrollbar):
self,
cnf: dict[str, Any] | None = ...,
*,
command: Callable[..., Tuple[float, float] | None] | str = ...,
command: Callable[..., tuple[float, float] | None] | str = ...,
cursor: tkinter._Cursor = ...,
orient: Literal["horizontal", "vertical"] = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
# config must be copy/pasted, otherwise ttk.Scrollbar().config is mypy error (don't know why)
@overload # type: ignore
def config(
self,
cnf: dict[str, Any] | None = ...,
*,
command: Callable[..., Tuple[float, float] | None] | str = ...,
command: Callable[..., tuple[float, float] | None] | str = ...,
cursor: tkinter._Cursor = ...,
orient: Literal["horizontal", "vertical"] = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def config(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
class Separator(Widget):
def __init__(
@@ -791,9 +791,9 @@ class Separator(Widget):
orient: Literal["horizontal", "vertical"] = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure
class Sizegrip(Widget):
@@ -815,9 +815,9 @@ class Sizegrip(Widget):
cursor: tkinter._Cursor = ...,
style: str = ...,
takefocus: tkinter._TakeFocusValue = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure
if sys.version_info >= (3, 7):
@@ -880,9 +880,9 @@ if sys.version_info >= (3, 7):
width: int = ...,
wrap: bool = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure # type: ignore
def set(self, value: Any) -> None: ...
@@ -955,11 +955,11 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
takefocus: tkinter._TakeFocusValue = ...,
xscrollcommand: tkinter._XYScrollCommand = ...,
yscrollcommand: tkinter._XYScrollCommand = ...,
) -> dict[str, Tuple[str, str, str, Any, Any]] | None: ...
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
config = configure
def bbox(self, item, column: _TreeviewColumnId | None = ...) -> Tuple[int, int, int, int] | Literal[""]: ... # type: ignore
def bbox(self, item, column: _TreeviewColumnId | None = ...) -> tuple[int, int, int, int] | Literal[""]: ... # type: ignore
def get_children(self, item: str | None = ...) -> Tuple[str, ...]: ...
def set_children(self, item: str, *newchildren: str) -> None: ...
@overload
@@ -994,7 +994,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
@overload
def heading(self, column: _TreeviewColumnId, option: Literal["text"]) -> str: ...
@overload
def heading(self, column: _TreeviewColumnId, option: Literal["image"]) -> Tuple[str]: ...
def heading(self, column: _TreeviewColumnId, option: Literal["image"]) -> tuple[str]: ...
@overload
def heading(self, column: _TreeviewColumnId, option: Literal["anchor"]) -> _tkinter.Tcl_Obj: ...
@overload
@@ -1034,7 +1034,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
@overload
def item(self, item: str, option: Literal["text"]) -> str: ...
@overload
def item(self, item: str, option: Literal["image"]) -> Literal[""] | Tuple[str]: ...
def item(self, item: str, option: Literal["image"]) -> Literal[""] | tuple[str]: ...
@overload
def item(self, item: str, option: Literal["values"]) -> Literal[""] | Tuple[Any, ...]: ...
@overload