Skip to content

Commit

Permalink
add types to most common tkinter.Entry methods (#5586)
Browse files Browse the repository at this point in the history
* most common tkinter.Entry methods

* type-ignore tkinter's lsp violation
  • Loading branch information
Akuli authored Jun 7, 2021
1 parent 0209b6f commit ec80fda
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions stdlib/tkinter/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,8 @@ class Checkbutton(Widget):
def select(self): ...
def toggle(self): ...

_EntryIndex = Union[str, int] # "INDICES" in manual page

class Entry(Widget, XView):
def __init__(
self,
Expand Down Expand Up @@ -1512,25 +1514,25 @@ class Entry(Widget, XView):
@overload
def configure(self, cnf: str) -> Tuple[str, str, str, Any, Any]: ...
config = configure
def delete(self, first, last: Optional[Any] = ...): ...
def get(self): ...
def icursor(self, index): ...
def index(self, index): ...
def insert(self, index, string): ...
def delete(self, first: _EntryIndex, last: _EntryIndex | None = ...) -> None: ...
def get(self) -> str: ...
def icursor(self, index: _EntryIndex) -> None: ...
def index(self, index: _EntryIndex) -> int: ...
def insert(self, index: _EntryIndex, string: str) -> None: ...
def scan_mark(self, x): ...
def scan_dragto(self, x): ...
def selection_adjust(self, index): ...
select_adjust: Any
def selection_clear(self): ...
select_clear: Any
def selection_from(self, index): ...
select_from: Any
def selection_present(self): ...
select_present: Any
def selection_range(self, start, end): ...
select_range: Any
def selection_to(self, index): ...
select_to: Any
def selection_adjust(self, index: _EntryIndex) -> None: ...
def selection_clear(self) -> None: ... # type: ignore
def selection_from(self, index: _EntryIndex) -> None: ...
def selection_present(self) -> bool: ...
def selection_range(self, start: _EntryIndex, end: _EntryIndex) -> None: ...
def selection_to(self, index: _EntryIndex) -> None: ...
select_adjust = selection_adjust
select_clear = selection_clear
select_from = selection_from
select_present = selection_present
select_range = selection_range
select_to = selection_to

class Frame(Widget):
def __init__(
Expand Down

0 comments on commit ec80fda

Please sign in to comment.