'Internal function.'

def _bind(self, what, sequence, func, add, needcleanup=1):

    if (type(func) is StringType):
        self.tk.call((what + (sequence, func)))
    elif func:
        funcid = self._register(func, self._substitute, needcleanup)
        cmd = ('%sif    {"[%s    %s]"    ==    "break"}    break\n' % (((add and '+') or ''), funcid, self._subst_format_str))
        self.tk.call((what + (sequence, cmd)))
        return funcid
    elif sequence:
        return self.tk.call((what + (sequence,)))
    else:
        return self.tk.splitlist(self.tk.call(what))
