Skip to content

Fix return type of tkinter.Text.search_all()#15768

Merged
JelleZijlstra merged 1 commit into
python:mainfrom
Akuli:tk3
May 11, 2026
Merged

Fix return type of tkinter.Text.search_all()#15768
JelleZijlstra merged 1 commit into
python:mainfrom
Akuli:tk3

Conversation

@Akuli
Copy link
Copy Markdown
Collaborator

@Akuli Akuli commented May 11, 2026

It returns a tuple of _tkinter.Tcl_Obj:

akuli@Akuli-Desktop ~/sourcestuff/Python-3.15.0b1 $ ./python 
Python 3.15.0b1 (main, May 11 2026, 17:35:51) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> t = tkinter.Text()
>>> t.pack()
>>> t.insert('end', 'hello world test thingy hello test')
>>> t.search_all('t', '1.0')
(<textindex object: '1.12'>, <textindex object: '1.15'>, <textindex object: '1.17'>, <textindex object: '1.30'>, <textindex object: '1.33'>)
>>> list(map(type,_))
[<class '_tkinter.Tcl_Obj'>, <class '_tkinter.Tcl_Obj'>, <class '_tkinter.Tcl_Obj'>, <class '_tkinter.Tcl_Obj'>, <class '_tkinter.Tcl_Obj'>]

@github-actions
Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/computation/ops.py:328: error: Need type annotation for "_binary_ops_dict" (hint: "_binary_ops_dict: dict[<type>, <type>] = ...")  [var-annotated]

@JelleZijlstra JelleZijlstra merged commit d80ed91 into python:main May 11, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants