mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Add more defaults to the stdlib (#9606)
Continuing work towards #8988. The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are: - Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine) - Defaults in non-py311 branches - Defaults for float parameters - Defaults for overloads
This commit is contained in:
@@ -36,7 +36,7 @@ __all__ = [
|
||||
]
|
||||
|
||||
def tclobjs_to_py(adict: dict[Any, Any]) -> dict[Any, Any]: ...
|
||||
def setup_master(master: Incomplete | None = ...): ...
|
||||
def setup_master(master: Incomplete | None = None): ...
|
||||
|
||||
_Padding: TypeAlias = Union[
|
||||
tkinter._ScreenUnits,
|
||||
@@ -52,32 +52,32 @@ _TtkCompound: TypeAlias = Literal["text", "image", tkinter._Compound]
|
||||
class Style:
|
||||
master: Incomplete
|
||||
tk: _tkinter.TkappType
|
||||
def __init__(self, master: tkinter.Misc | None = ...) -> None: ...
|
||||
def configure(self, style, query_opt: Incomplete | None = ..., **kw): ...
|
||||
def map(self, style, query_opt: Incomplete | None = ..., **kw): ...
|
||||
def lookup(self, style, option, state: Incomplete | None = ..., default: Incomplete | None = ...): ...
|
||||
def layout(self, style, layoutspec: Incomplete | None = ...): ...
|
||||
def __init__(self, master: tkinter.Misc | None = None) -> None: ...
|
||||
def configure(self, style, query_opt: Incomplete | None = None, **kw): ...
|
||||
def map(self, style, query_opt: Incomplete | None = None, **kw): ...
|
||||
def lookup(self, style, option, state: Incomplete | None = None, default: Incomplete | None = None): ...
|
||||
def layout(self, style, layoutspec: Incomplete | None = None): ...
|
||||
def element_create(self, elementname, etype, *args, **kw) -> None: ...
|
||||
def element_names(self): ...
|
||||
def element_options(self, elementname): ...
|
||||
def theme_create(self, themename, parent: Incomplete | None = ..., settings: Incomplete | None = ...) -> None: ...
|
||||
def theme_create(self, themename, parent: Incomplete | None = None, settings: Incomplete | None = None) -> None: ...
|
||||
def theme_settings(self, themename, settings) -> None: ...
|
||||
def theme_names(self) -> tuple[str, ...]: ...
|
||||
@overload
|
||||
def theme_use(self, themename: str) -> None: ...
|
||||
@overload
|
||||
def theme_use(self, themename: None = ...) -> str: ...
|
||||
def theme_use(self, themename: None = None) -> str: ...
|
||||
|
||||
class Widget(tkinter.Widget):
|
||||
def __init__(self, master: tkinter.Misc | None, widgetname, kw: Incomplete | None = ...) -> None: ...
|
||||
def __init__(self, master: tkinter.Misc | None, widgetname, kw: Incomplete | None = None) -> None: ...
|
||||
def identify(self, x: int, y: int) -> str: ...
|
||||
def instate(self, statespec, callback: Incomplete | None = ..., *args, **kw): ...
|
||||
def state(self, statespec: Incomplete | None = ...): ...
|
||||
def instate(self, statespec, callback: Incomplete | None = None, *args, **kw): ...
|
||||
def state(self, statespec: Incomplete | None = None): ...
|
||||
|
||||
class Button(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
command: tkinter._ButtonCommand = ...,
|
||||
@@ -98,7 +98,7 @@ class Button(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: tkinter._ButtonCommand = ...,
|
||||
compound: _TtkCompound = ...,
|
||||
@@ -122,7 +122,7 @@ class Button(Widget):
|
||||
class Checkbutton(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
command: tkinter._ButtonCommand = ...,
|
||||
@@ -148,7 +148,7 @@ class Checkbutton(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: tkinter._ButtonCommand = ...,
|
||||
compound: _TtkCompound = ...,
|
||||
@@ -174,8 +174,8 @@ class Checkbutton(Widget):
|
||||
class Entry(Widget, tkinter.Entry):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
widget: str | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
widget: str | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ..., # undocumented
|
||||
class_: str = ...,
|
||||
@@ -199,7 +199,7 @@ class Entry(Widget, tkinter.Entry):
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -224,7 +224,7 @@ class Entry(Widget, tkinter.Entry):
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -252,7 +252,7 @@ class Entry(Widget, tkinter.Entry):
|
||||
class Combobox(Entry):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ..., # undocumented
|
||||
class_: str = ...,
|
||||
@@ -279,7 +279,7 @@ class Combobox(Entry):
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -307,7 +307,7 @@ class Combobox(Entry):
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -331,13 +331,13 @@ class Combobox(Entry):
|
||||
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
|
||||
@overload
|
||||
def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
def current(self, newindex: int | None = ...) -> int: ...
|
||||
def current(self, newindex: int | None = None) -> int: ...
|
||||
def set(self, value: Any) -> None: ...
|
||||
|
||||
class Frame(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
border: tkinter._ScreenUnits = ...,
|
||||
borderwidth: tkinter._ScreenUnits = ...,
|
||||
@@ -354,7 +354,7 @@ class Frame(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
border: tkinter._ScreenUnits = ...,
|
||||
borderwidth: tkinter._ScreenUnits = ...,
|
||||
@@ -373,7 +373,7 @@ class Frame(Widget):
|
||||
class Label(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
anchor: tkinter._Anchor = ...,
|
||||
background: tkinter._Color = ...,
|
||||
@@ -401,7 +401,7 @@ class Label(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
anchor: tkinter._Anchor = ...,
|
||||
background: tkinter._Color = ...,
|
||||
@@ -431,7 +431,7 @@ class Label(Widget):
|
||||
class Labelframe(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
border: tkinter._ScreenUnits = ...,
|
||||
borderwidth: tkinter._ScreenUnits = ..., # undocumented
|
||||
@@ -452,7 +452,7 @@ class Labelframe(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
border: tkinter._ScreenUnits = ...,
|
||||
borderwidth: tkinter._ScreenUnits = ...,
|
||||
@@ -477,7 +477,7 @@ LabelFrame = Labelframe
|
||||
class Menubutton(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
compound: _TtkCompound = ...,
|
||||
@@ -498,7 +498,7 @@ class Menubutton(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
compound: _TtkCompound = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -521,7 +521,7 @@ class Menubutton(Widget):
|
||||
class Notebook(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -535,7 +535,7 @@ class Notebook(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
height: int = ...,
|
||||
@@ -564,15 +564,15 @@ class Notebook(Widget):
|
||||
def identify(self, x: int, y: int) -> str: ...
|
||||
def index(self, tab_id): ...
|
||||
def insert(self, pos, child, **kw) -> None: ...
|
||||
def select(self, tab_id: Incomplete | None = ...): ...
|
||||
def tab(self, tab_id, option: Incomplete | None = ..., **kw): ...
|
||||
def select(self, tab_id: Incomplete | None = None): ...
|
||||
def tab(self, tab_id, option: Incomplete | None = None, **kw): ...
|
||||
def tabs(self): ...
|
||||
def enable_traversal(self) -> None: ...
|
||||
|
||||
class Panedwindow(Widget, tkinter.PanedWindow):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -588,7 +588,7 @@ class Panedwindow(Widget, tkinter.PanedWindow):
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
height: int = ...,
|
||||
@@ -602,7 +602,7 @@ class Panedwindow(Widget, tkinter.PanedWindow):
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
height: int = ...,
|
||||
@@ -614,15 +614,15 @@ class Panedwindow(Widget, tkinter.PanedWindow):
|
||||
def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
forget: Incomplete
|
||||
def insert(self, pos, child, **kw) -> None: ...
|
||||
def pane(self, pane, option: Incomplete | None = ..., **kw): ...
|
||||
def sashpos(self, index, newpos: Incomplete | None = ...): ...
|
||||
def pane(self, pane, option: Incomplete | None = None, **kw): ...
|
||||
def sashpos(self, index, newpos: Incomplete | None = None): ...
|
||||
|
||||
PanedWindow = Panedwindow
|
||||
|
||||
class Progressbar(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -640,7 +640,7 @@ class Progressbar(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
length: tkinter._ScreenUnits = ...,
|
||||
@@ -656,14 +656,14 @@ class Progressbar(Widget):
|
||||
@overload
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
config = configure
|
||||
def start(self, interval: Literal["idle"] | int | None = ...) -> None: ...
|
||||
def step(self, amount: float | None = ...) -> None: ...
|
||||
def start(self, interval: Literal["idle"] | int | None = None) -> None: ...
|
||||
def step(self, amount: float | None = None) -> None: ...
|
||||
def stop(self) -> None: ...
|
||||
|
||||
class Radiobutton(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
command: tkinter._ButtonCommand = ...,
|
||||
@@ -685,7 +685,7 @@ class Radiobutton(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: tkinter._ButtonCommand = ...,
|
||||
compound: _TtkCompound = ...,
|
||||
@@ -711,7 +711,7 @@ class Radiobutton(Widget):
|
||||
class Scale(Widget, tkinter.Scale): # type: ignore[misc]
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
command: str | Callable[[str], object] = ...,
|
||||
@@ -730,7 +730,7 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc]
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: str | Callable[[str], object] = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -750,7 +750,7 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc]
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: str | Callable[[str], object] = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -766,13 +766,13 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc]
|
||||
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
|
||||
@overload
|
||||
def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
def get(self, x: int | None = ..., y: int | None = ...) -> float: ...
|
||||
def get(self, x: int | None = None, y: int | None = None) -> float: ...
|
||||
|
||||
# type ignore, because identify() methods of Widget and tkinter.Scale are incompatible
|
||||
class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc]
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
command: Callable[..., tuple[float, float] | None] | str = ...,
|
||||
@@ -785,7 +785,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc]
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: Callable[..., tuple[float, float] | None] | str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -799,7 +799,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc]
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
command: Callable[..., tuple[float, float] | None] | str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -813,7 +813,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc]
|
||||
class Separator(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -825,7 +825,7 @@ class Separator(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
orient: Literal["horizontal", "vertical"] = ...,
|
||||
@@ -839,7 +839,7 @@ class Separator(Widget):
|
||||
class Sizegrip(Widget):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -850,7 +850,7 @@ class Sizegrip(Widget):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
style: str = ...,
|
||||
@@ -863,7 +863,7 @@ class Sizegrip(Widget):
|
||||
class Spinbox(Entry):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ..., # undocumented
|
||||
class_: str = ...,
|
||||
@@ -894,7 +894,7 @@ class Spinbox(Entry):
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
background: tkinter._Color = ...,
|
||||
command: Callable[[], object] | str | list[str] | tuple[str, ...] = ...,
|
||||
@@ -958,7 +958,7 @@ _TreeviewColumnId: TypeAlias = int | str # manual page: "COLUMN IDENTIFIERS"
|
||||
class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
columns: str | list[str] | tuple[str, ...] = ...,
|
||||
@@ -981,7 +981,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
@overload
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
columns: str | list[str] | tuple[str, ...] = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
@@ -998,8 +998,8 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
@overload
|
||||
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[override]
|
||||
def get_children(self, item: str | None = ...) -> tuple[str, ...]: ...
|
||||
def bbox(self, item, column: _TreeviewColumnId | None = None) -> tuple[int, int, int, int] | Literal[""]: ... # type: ignore[override]
|
||||
def get_children(self, item: str | None = None) -> tuple[str, ...]: ...
|
||||
def set_children(self, item: str, *newchildren: str) -> None: ...
|
||||
@overload
|
||||
def column(self, column: _TreeviewColumnId, option: Literal["width", "minwidth"]) -> int: ...
|
||||
@@ -1015,7 +1015,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
def column(
|
||||
self,
|
||||
column: _TreeviewColumnId,
|
||||
option: None = ...,
|
||||
option: None = None,
|
||||
*,
|
||||
width: int = ...,
|
||||
minwidth: int = ...,
|
||||
@@ -1027,7 +1027,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
def detach(self, *items: str) -> None: ...
|
||||
def exists(self, item: str) -> bool: ...
|
||||
@overload # type: ignore[override]
|
||||
def focus(self, item: None = ...) -> str: ... # can return empty string
|
||||
def focus(self, item: None = None) -> str: ... # can return empty string
|
||||
@overload
|
||||
def focus(self, item: str) -> Literal[""]: ...
|
||||
@overload
|
||||
@@ -1041,12 +1041,12 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
@overload
|
||||
def heading(self, column: _TreeviewColumnId, option: str) -> Any: ...
|
||||
@overload
|
||||
def heading(self, column: _TreeviewColumnId, option: None = ...) -> _TreeviewHeaderDict: ... # type: ignore[misc]
|
||||
def heading(self, column: _TreeviewColumnId, option: None = None) -> _TreeviewHeaderDict: ... # type: ignore[misc]
|
||||
@overload
|
||||
def heading(
|
||||
self,
|
||||
column: _TreeviewColumnId,
|
||||
option: None = ...,
|
||||
option: None = None,
|
||||
*,
|
||||
text: str = ...,
|
||||
image: tkinter._ImageSpec = ...,
|
||||
@@ -1063,7 +1063,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
self,
|
||||
parent: str,
|
||||
index: int | Literal["end"],
|
||||
iid: str | None = ...,
|
||||
iid: str | None = None,
|
||||
*,
|
||||
id: str = ..., # same as iid
|
||||
text: str = ...,
|
||||
@@ -1085,12 +1085,12 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
@overload
|
||||
def item(self, item: str, option: str) -> Any: ...
|
||||
@overload
|
||||
def item(self, item: str, option: None = ...) -> _TreeviewItemDict: ... # type: ignore[misc]
|
||||
def item(self, item: str, option: None = None) -> _TreeviewItemDict: ... # type: ignore[misc]
|
||||
@overload
|
||||
def item(
|
||||
self,
|
||||
item: str,
|
||||
option: None = ...,
|
||||
option: None = None,
|
||||
*,
|
||||
text: str = ...,
|
||||
image: tkinter._ImageSpec = ...,
|
||||
@@ -1107,23 +1107,23 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
if sys.version_info >= (3, 8):
|
||||
def selection(self) -> tuple[str, ...]: ...
|
||||
else:
|
||||
def selection(self, selop: Incomplete | None = ..., items: Incomplete | None = ...) -> tuple[str, ...]: ...
|
||||
def selection(self, selop: Incomplete | None = ..., items: Incomplete | None = None) -> tuple[str, ...]: ...
|
||||
|
||||
def selection_set(self, items: str | list[str] | tuple[str, ...]) -> None: ...
|
||||
def selection_add(self, items: str | list[str] | tuple[str, ...]) -> None: ...
|
||||
def selection_remove(self, items: str | list[str] | tuple[str, ...]) -> None: ...
|
||||
def selection_toggle(self, items: str | list[str] | tuple[str, ...]) -> None: ...
|
||||
@overload
|
||||
def set(self, item: str, column: None = ..., value: None = ...) -> dict[str, Any]: ...
|
||||
def set(self, item: str, column: None = None, value: None = None) -> dict[str, Any]: ...
|
||||
@overload
|
||||
def set(self, item: str, column: _TreeviewColumnId, value: None = ...) -> Any: ...
|
||||
def set(self, item: str, column: _TreeviewColumnId, value: None = None) -> Any: ...
|
||||
@overload
|
||||
def set(self, item: str, column: _TreeviewColumnId, value: Any) -> Literal[""]: ...
|
||||
# There's no tag_unbind() or 'add' argument for whatever reason.
|
||||
# Also, it's 'callback' instead of 'func' here.
|
||||
@overload
|
||||
def tag_bind(
|
||||
self, tagname: str, sequence: str | None = ..., callback: Callable[[tkinter.Event[Treeview]], object] | None = ...
|
||||
self, tagname: str, sequence: str | None = None, callback: Callable[[tkinter.Event[Treeview]], object] | None = None
|
||||
) -> str: ...
|
||||
@overload
|
||||
def tag_bind(self, tagname: str, sequence: str | None, callback: str) -> None: ...
|
||||
@@ -1139,7 +1139,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
def tag_configure(
|
||||
self,
|
||||
tagname: str,
|
||||
option: None = ...,
|
||||
option: None = None,
|
||||
*,
|
||||
# There is also 'text' and 'anchor', but they don't seem to do anything, using them is likely a bug
|
||||
foreground: tkinter._Color = ...,
|
||||
@@ -1148,7 +1148,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
image: tkinter._ImageSpec = ...,
|
||||
) -> _TreeviewTagDict | Any: ... # can be None but annoying to check
|
||||
@overload
|
||||
def tag_has(self, tagname: str, item: None = ...) -> tuple[str, ...]: ...
|
||||
def tag_has(self, tagname: str, item: None = None) -> tuple[str, ...]: ...
|
||||
@overload
|
||||
def tag_has(self, tagname: str, item: str) -> bool: ...
|
||||
|
||||
@@ -1158,10 +1158,10 @@ class LabeledScale(Frame):
|
||||
# TODO: don't any-type **kw. That goes to Frame.__init__.
|
||||
def __init__(
|
||||
self,
|
||||
master: tkinter.Misc | None = ...,
|
||||
variable: tkinter.IntVar | tkinter.DoubleVar | None = ...,
|
||||
from_: float = ...,
|
||||
to: float = ...,
|
||||
master: tkinter.Misc | None = None,
|
||||
variable: tkinter.IntVar | tkinter.DoubleVar | None = None,
|
||||
from_: float = 0,
|
||||
to: float = 10,
|
||||
*,
|
||||
compound: Literal["top", "bottom"] = ...,
|
||||
**kw,
|
||||
@@ -1174,7 +1174,7 @@ class OptionMenu(Menubutton):
|
||||
self,
|
||||
master,
|
||||
variable,
|
||||
default: str | None = ...,
|
||||
default: str | None = None,
|
||||
*values: str,
|
||||
# rest of these are keyword-only because *args syntax used above
|
||||
style: str = ...,
|
||||
@@ -1183,4 +1183,4 @@ class OptionMenu(Menubutton):
|
||||
) -> None: ...
|
||||
# configure, config, cget, destroy are inherited from Menubutton
|
||||
# destroy and __setitem__ are overridden, signature does not change
|
||||
def set_menu(self, default: Incomplete | None = ..., *values) -> None: ...
|
||||
def set_menu(self, default: Incomplete | None = None, *values) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user