gh-66410: Do not stringify arguments of Tkinter callback#98592
Merged
serhiy-storchaka merged 5 commits intopython:mainfrom May 7, 2024
Merged
gh-66410: Do not stringify arguments of Tkinter callback#98592serhiy-storchaka merged 5 commits intopython:mainfrom
serhiy-storchaka merged 5 commits intopython:mainfrom
Conversation
Callbacks registered in the tkinter module now take arguments as various Python objects (int, float, bytes, tuple), not just str. To restore the previous behavior set tkinter module global wantobject to 1 before creating the Tk object or call the wantobject() method of the Tk object with argument 1. Calling it with argument 2 restores the current default behavior.
Member
|
I did a first read. I think the news/new messages could be clearer, but need to think more about a suggestion. |
Member
Author
|
The IDLE tests exposed two failures. One is specific to IDLE, its clever use of redefining the Tcl command corresponded to a widget. It is not typical use of Tkinter and I do not think that many other code will have such issue. Other one is more generic, related to creating the Event objects, it would affect more code. We need to add special Event-related code in Tkinter tests and check what more can be affected by this change. This is why this PR is still a draft. |
SonicField
pushed a commit
to SonicField/cpython
that referenced
this pull request
May 8, 2024
…nGH-98592) Callbacks registered in the tkinter module now take arguments as various Python objects (int, float, bytes, tuple), not just str. To restore the previous behavior set tkinter module global wantobject to 1 before creating the Tk object or call the wantobject() method of the Tk object with argument 1. Calling it with argument 2 restores the current default behavior.
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this pull request
May 8, 2024
It was set to 2 in 65f5e58 (pythonGH-98592).
serhiy-storchaka
added a commit
that referenced
this pull request
May 20, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
May 20, 2024
pythonGH-118784) It was set to 2 in 65f5e58 (pythonGH-98592). (cherry picked from commit e188527) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka
added a commit
that referenced
this pull request
May 20, 2024
estyxx
pushed a commit
to estyxx/cpython
that referenced
this pull request
Jul 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Callbacks registered in the tkinter module now take arguments as various Python objects (int, float, bytes, tuple), not just str.
To restore the previous behavior set tkinter module global wantobject to 1 before creating the Tk object or call the wantobject() method of the Tk object with argument 1.
Calling it with argument 2 restores the current default behavior.