don't allow _TextIndex in last argument of tkinter.Text.replace() or insert() (#4927)

Fixes #4919
This commit is contained in:
Akuli
2021-01-11 16:34:46 +02:00
committed by GitHub
parent 4c50d7d266
commit fe07a522b7

View File

@@ -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(