gh-153513: Remove redundant conversions in tkinter tests#153520
Merged
serhiy-storchaka merged 1 commit intoJul 10, 2026
Merged
Conversation
Now that index, window, parsedVarName and pixel options are returned as str, int or float, drop the str()/int()/float() wrappers that only worked around Tcl_Obj results. The generated test_configure_* tests now also check that int- and float-valued options are returned as numbers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Test-only follow-up to gh-153513 (#153514).
Now that
index,windowandparsedVarNameoptions are returned asstrand unitlesspixeloptions asint/float, this drops thestr()/int()/float()/getint()wrappers that only worked around the previousTcl_Objresults. Where the value crosseswantobjectsmodes (anint/floatwith objects enabled, a string with objects disabled), the bare wrapper is replaced with a mode-aware exact comparison rather than dropped, so the returned type is verified instead of masked.The generated
test_configure_*tests also gain a check that an int- or float-valued option is returned as a number (not aTcl_Obj), and that an int-valued option is not returned as a float.Wrappers are kept where the returned type is not uniform: resource types (
color,bitmap,font,cursor), screen distances with a unit suffix, canvas item options andOptionMenu -width(which Tk returns as strings), and plain-string options.Tested with Tk 8.6, 9.0 and 9.1, with objects enabled and disabled.
🤖 Generated with Claude Code