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

Function _val_or_dict

Lib/tkinter/ttk.py:279–293  ·  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

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

_splitdictFunction · 0.90
_format_optdictFunction · 0.85
lenFunction · 0.85
callMethod · 0.45

Tested by

no test coverage detected