[issue15133] tkinter.BooleanVar.get() behavior and docstring disagree

Serhiy Storchaka report at bugs.python.org
Tue Jul 8 09:54:39 CEST 2014


Serhiy Storchaka added the comment:

Here is a patch.

1) getboolean() and BooleanVar.get() now always return bool. Wrapping the result of getboolean() into bool() is not more needed.

2) getboolean() and BooleanVar.get() now works with Tcl_Obj. This makes Tkinter more robust against future Tcl/Tk changes.

3) An exception is raised if an argument to BooleanVar.set() couldn't be considered as boolean value. An argument is converted to canonized 0/1 values. This makes errors to be exposed earlier.

Similar changes should be made for getint() and getdouble().

----------
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file35897/tkinter_getboolean.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15133>
_______________________________________


More information about the Python-bugs-list mailing list