MCPcopy Index your code
hub / github.com/python/cpython / _tclobj_to_py

Function _tclobj_to_py

Lib/tkinter/ttk.py:311–324  ·  view source on GitHub ↗

Return value converted from Tcl object to Python object.

(val)

Source from the content-addressed store, hash-verified

309 return x
310
311def _tclobj_to_py(val):
312 """Return value converted from Tcl object to Python object."""
313 if val and hasattr(val, '__len__') and not isinstance(val, str):
314 if getattr(val[0], 'typename', None) == 'StateSpec':
315 val = _list_from_statespec(val)
316 else:
317 val = list(map(_convert_stringval, val))
318
319 elif hasattr(val, 'typename'): # some other (single) Tcl object
320 val = _convert_stringval(val)
321
322 if isinstance(val, tuple) and len(val) == 0:
323 return ''
324 return val
325
326def tclobjs_to_py(adict):
327 """Returns adict with its values converted from Tcl objects to Python

Callers 1

tclobjs_to_pyFunction · 0.85

Calls 3

_list_from_statespecFunction · 0.85
listClass · 0.85
_convert_stringvalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…