This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tkinter
Recipients klappnase, serhiy.storchaka, tkinter
Date 2016-10-23.09:23:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1477214599.89.0.700687661204.issue28498@psf.upfronthosting.co.za>
In-reply-to
Content
Hi klappnase,
you are right with the function tk_busy_configure(). Maybe there is a little bit of code duplicated. I think that it's better to directly change the Tkinter function _configure() to make it more general:
    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))

I think that it's interesting to do this change because the function is more general and maybe can be used again in the future for new features in Tcl Tk. This way, we avoid code duplication (Dont Repeat Yourself is one of the philosophes of Python). This is the new version of tk_busy_configure using the mentioned change:
    def tk_busy_configure(self, cnf=None, **kw):
        return self._configure(('tk', 'busy', 'configure', self._w), cnf, kw)

It's more concise.
I disagree with tk_busy_status(). It's better to be more predictable an return the same than the other methods that uses getboolean(). If there is a bug, it's better to solve that bug.  Could you please guive me an code example that replicates the bug?

The _getboolean function is implemented in _tkinter.c. This is the implementation:
    static PyObject *
    Tkapp_GetBoolean (self, args)
         PyObject *self;
         PyObject *args;
    {
      char *s;
      int v;

      if (!PyArg_Parse (args, "s", &s))
        return NULL;
      if (Tcl_GetBoolean (Tkapp_Interp (self), s, &v) == TCL_ERROR)
        return Tkinter_Error (self);
      return Py_BuildValue ("i", v);
    }

A priori , I can't appreciate any bug in this function. If there is some bug, it's in another place of the C code.
History
Date User Action Args
2016-10-23 09:23:19tkintersetrecipients: + tkinter, klappnase, serhiy.storchaka
2016-10-23 09:23:19tkintersetmessageid: <1477214599.89.0.700687661204.issue28498@psf.upfronthosting.co.za>
2016-10-23 09:23:19tkinterlinkissue28498 messages
2016-10-23 09:23:19tkintercreate