-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-66410: Do not stringify arguments of Tkinter callback #98592
gh-66410: Do not stringify arguments of Tkinter callback #98592
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.
I did a first read. I think the news/new messages could be clearer, but need to think more about a suggestion. |
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. |
…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.
It was set to 2 in 65f5e58 (pythonGH-98592).
pythonGH-118784) It was set to 2 in 65f5e58 (pythonGH-98592). (cherry picked from commit e188527) Co-authored-by: Serhiy Storchaka <[email protected]>
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.