Use tkinter wrapper methods instead of raw Tcl calls in turtle and IDLE#152414
Conversation
|
I was thinking about asking you if any of the tk calls could be updated. Are the 2 new root.x wrapper methods in IDLE in main only or at least in 3.15, so an IDLE backport can be done? Either way, I think that merging this now and dealing with a possible but very unlikely future backport merge conflict is better than waiting a couple of years until these changes can be backported completely. There are about 20 'after' 'info' calls in tests that can be replaced by after_info and backported to 3.13. I will do these separately. Did you check whether any of the other ~20 other calls replaced here now have wrappers? |
|
tk_scaling is 3.15, wm_attributes -- 3.13, winfo_server -- always. after_info -- 3.13. I can add after_info here. |
|
Emscripten build and test failed. The [Explain error] AI 'failed', with no explanation. Since the AI apparently replaced the ability to manually scan the test log, I just reran. |
|
I presume you made changes with Opus. Can it undo 3.x changes for backport to 3.x?? For each file in the diff, [...] on the right expands to view, edit, or delete file, but not revert file. |
* turtle: wm_attributes(topmost=...); * idlelib.macosx: winfo_server(); * idlelib tests: after_info(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
c514b39 to
ea032fc
Compare
|
Split out to #152465. I force-pushed to create a single simple commit message. |
|
Do you want me to merge and tend to backports, or are you still thinking about these 2 PRs? |
|
I only wait for your approve, because it is just cosmetic change. |
|
In the winfo server and wm attributes replacements, I don't know what the original I otherwise approve of the IDLE changes and would like them backported. I don't care about the turtle change either way. |
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
GH-152648 is a backport of this pull request to the 3.15 branch. |
It was the path to the toplevel widget (the root in that case). In methods it is inferred from |
… and IDLE (GH-152414) (GH-152648) Use tkinter wrapper methods instead of raw Tcl calls in turtle and IDLE (GH-152414) * turtle: wm_attributes(topmost=...); * idlelib.macosx: winfo_server(); * idlelib tests: after_info(). (cherry picked from commit fc866dc) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…LE (pythonGH-152414) * turtle: wm_attributes(topmost=...); * idlelib.macosx: winfo_server(); * idlelib tests: after_info(). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
|
GH-152662 is a backport of this pull request to the 3.14 branch. |
|
GH-152663 is a backport of this pull request to the 3.13 branch. |
|
Backports merged, thank you. |
Replace explicit
tk.call()invocations inturtleandidlelibwith the equivalent higher-level tkinter wrapper methods. No behavior change.turtle:rootwindow.wm_attributes(topmost=...)instead ofcall('wm', 'attributes', '.', '-topmost', ...), using the keyword form ofwm_attributes()(added in wm_attributes doesn't take keyword arguments #43457).idlelib.macosx._init_tk_type():root.winfo_server()instead ofroot.tk.call('winfo', 'server', '.').idlelibtests:after_info()instead oftk.call('after', 'info').