def _list_from_statespec(stuple):
    nval = []
    for val in stuple:
        typename = getattr(val, 'typename', None)
        if typename is None:
            nval.append(val)
        else: # this is a Tcl object
            val = str(val)
            if typename == 'StateSpec':
                val = val.split()
            nval.append(val)

    it = iter(nval)
    return [_flatten(spec) for spec in zip(it, it)]
Construct a list from the given statespec tuple according to the
dataset/ETHPy150Open francelabs/datafari/windows/python/Lib/lib-tk/ttk.py/_list_from_statespec