You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove the bogus default values of parameters in tkinter Misc.wait_variable(), setvar() and getvar() #152587
Misc.wait_variable(), Misc.setvar() and Misc.getvar() have default values for parameters that should be required: name='PY_VAR' (all three) and value='1' (setvar).
'PY_VAR' is not a meaningful variable name -- tkinter auto-generates names as PY_VAR0, PY_VAR1, etc., never the bare 'PY_VAR' -- so calling these methods without a name operates on a variable that almost never exists. Likewise, defaulting setvar's value to '1' is arbitrary.
These defaults were only recently documented (gh-86726) and should not be advertised. As a first step, undocument them (backported).
Then make the parameters required by dropping the defaults from wait_variable(name), getvar(name) and setvar(name, value) (the waitvar alias follows). This is a behavior change for 3.16 only; calls relying on the defaults will raise TypeError instead of silently operating on a useless variable. If this proves disruptive during the development period, it can be reverted.
Activity
gh-152587: Stop documenting bogus default values in tkinter variable …
[3.14] gh-152587: Stop documenting bogus default values in tkinter va…
[3.13] gh-152587: Stop documenting bogus default values in tkinter va…
[3.15] gh-152587: Stop documenting bogus default values in tkinter va…
gh-152587: Make name and value required in tkinter variable methods (G…