Miguel added the comment:
Yes, sure. It will break code. Maybe it's better to be explicit than implicit
(another Python motto). It's also necessary to change configure(). This is the
code for my version of _configure() and configure():
def _configure(self, cmd, cnf, kw):
"""Internal function."""
if kw:
cnf = _cnfmerge((cnf, kw))
elif cnf:
cnf = _cnfmerge(cnf)
if cnf is None:
return self._getconfigure(cmd)
if isinstance(cnf, str):
return self._getconfigure1(cmd + ('-'+cnf,))
self.tk.call(cmd + self._options(cnf))
# These used to be defined in Widget:
def configure(self, cnf=None, **kw):
"""Configure resources of a widget.
The values for resources are specified as keyword
arguments. To get an overview about
the allowed keyword arguments call the method keys.
"""
return self._configure((self._w, 'configure'), cnf, kw)
The semantics of getboolean is clear for me: Transform a true and false value
in *Tcl* to an integer value: 1 or 0:
def getboolean(s):
"""Convert true and false to integer values 1 and 0."""
return _default_root.tk.getboolean(s)
I think that the C implementation of getboolean is right.
The true values for Tcl are: 1, true, yes.
And the false values are: 0, false, no
>>> tk.getboolean("true")
True
>>> tk.getboolean("false")
False
>>> tk.getboolean("0")
False
>>> tk.getboolean("1")
True
>>> tk.getboolean("yes")
True
>>> tk.getboolean("no")
False
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28498>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com