def tclobjs_to_py(adict):
 for (opt, val) in adict.iteritems():
  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'):
   val = _convert_stringval(val)
  adict[opt] = val
 return adict

def tclobjs_to_py ( adict ) : for ( opt , val ) in adict . iteritems ( ) : 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' ) : val = _convert_stringval ( val ) adict [ opt ] = val return adict
returns adict with its values converted from tcl objects to python objects .