MCPcopy Index your code
hub / github.com/RustPython/RustPython / _tclobj_to_py

Function _tclobj_to_py

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

Return value converted from Tcl object to Python object.

(val)

Source from the content-addressed store, hash-verified

311 return x
312
313def _tclobj_to_py(val):
314 """Return value converted from Tcl object to Python object."""
315 if val and hasattr(val, '__len__') and not isinstance(val, str):
316 if getattr(val[0], 'typename', None) == 'StateSpec':
317 val = _list_from_statespec(val)
318 else:
319 val = list(map(_convert_stringval, val))
320
321 elif hasattr(val, 'typename'): # some other (single) Tcl object
322 val = _convert_stringval(val)
323
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 6

hasattrFunction · 0.85
isinstanceFunction · 0.85
getattrFunction · 0.85
_list_from_statespecFunction · 0.85
listClass · 0.85
_convert_stringvalFunction · 0.85

Tested by

no test coverage detected