def _tclobj_to_py(val):
    if val and hasattr(val, '__len__') and not isinstance(val, basestring):
        if getattr(val[0], 'typename', None) == 'StateSpec':
            val = _list_from_statespec(val)
        else:
            val = map(_convert_stringval, val)

    elif hasattr(val, 'typename'): # some other (single) Tcl object
        val = _convert_stringval(val)

    return val
Return value converted from Tcl object to Python object.
dataset/ETHPy150Open francelabs/datafari/windows/python/Lib/lib-tk/ttk.py/_tclobj_to_py