Python3Script Xojo Plugin

Python3Dictionary.SetDefault Method (console safe)

Returns the value corresponding to key from the dictionary. If the key is not in the dict, it is inserted with value defaultValue and defaultValue is returned.

SetDefault(
   key as String,
   defaultValue as Python3EntityBase) as Python3Entity

Parameters

key
The key to look for.
defaultValue
The default value to set and return if key is not found.

Returns

Python3Entity
The found key or the default value.

Remarks

This function does same as dict.setdefault() would do inside of Python.

See Also

Python3Dictionary Class