From fe07a522b7bd81fe52371aaedcbb0cf5edea88ba Mon Sep 17 00:00:00 2001 From: Akuli Date: Mon, 11 Jan 2021 16:34:46 +0200 Subject: [PATCH] don't allow _TextIndex in last argument of tkinter.Text.replace() or insert() (#4927) Fixes #4919 --- stdlib/3/tkinter/__init__.pyi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/stdlib/3/tkinter/__init__.pyi b/stdlib/3/tkinter/__init__.pyi index eeb56628b..105cf747b 100644 --- a/stdlib/3/tkinter/__init__.pyi +++ b/stdlib/3/tkinter/__init__.pyi @@ -2494,7 +2494,7 @@ class Text(Widget, XView, YView): def image_create(self, index, cnf=..., **kw): ... def image_names(self): ... def index(self, index: _TextIndex) -> str: ... - def insert(self, index: _TextIndex, chars: str, *args: Union[_TextIndex, str, _TkinterSequence[str]]) -> None: ... + def insert(self, index: _TextIndex, chars: str, *args: Union[str, _TkinterSequence[str]]) -> None: ... @overload def mark_gravity(self, markName: str, direction: None = ...) -> Literal["left", "right"]: ... @overload @@ -2507,9 +2507,7 @@ class Text(Widget, XView, YView): # **kw of peer_create is same as the kwargs of Text.__init__ def peer_create(self, newPathName: Union[str, Text], cnf: Dict[str, Any] = ..., **kw: Any) -> None: ... def peer_names(self) -> Tuple[_tkinter.Tcl_Obj, ...]: ... - def replace( - self, index1: _TextIndex, index2: _TextIndex, chars: str, *args: Union[_TextIndex, str, _TkinterSequence[str]] - ) -> None: ... + def replace(self, index1: _TextIndex, index2: _TextIndex, chars: str, *args: Union[str, _TkinterSequence[str]]) -> None: ... def scan_mark(self, x: int, y: int) -> None: ... def scan_dragto(self, x: int, y: int) -> None: ... def search(