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

Function _val_or_dict

Lib/tkinter/ttk.py:277–291  ·  view source on GitHub ↗

Format options then call Tk command with args and options and return the appropriate result. If no option is specified, a dict is returned. If an option is specified with the None value, the value for that option is returned. Otherwise, the function just sets the passed options and

(tk, options, *args)

Source from the content-addressed store, hash-verified

275 return res
276
277def _val_or_dict(tk, options, *args):
278 """Format options then call Tk command with args and options and return
279 the appropriate result.
280
281 If no option is specified, a dict is returned. If an option is
282 specified with the None value, the value for that option is returned.
283 Otherwise, the function just sets the passed options and the caller
284 shouldn't be expecting a return value anyway."""
285 options = _format_optdict(options)
286 res = tk.call(*(args + options))
287
288 if len(options) % 2: # option specified without a value, return its value
289 return res
290
291 return _splitdict(tk, res, conv=_tclobj_to_py)
292
293def _convert_stringval(value):
294 """Converts a value to, hopefully, a more appropriate Python object."""

Callers 7

configureMethod · 0.85
tabMethod · 0.85
paneMethod · 0.85
columnMethod · 0.85
headingMethod · 0.85
itemMethod · 0.85
tag_configureMethod · 0.85

Calls 3

_splitdictFunction · 0.90
_format_optdictFunction · 0.85
callMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…