diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 3e6e196e4c..e5363d7300 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -256,6 +256,13 @@ Returns the corresponding value for the given [param key] in the dictionary. If the [param key] does not exist, returns [param default], or [code]null[/code] if the parameter is omitted. + [b]Note:[/b] If the [param default] argument is computationally expensive or has unwanted side effects, consider using the [method has] method instead: + [codeblock] + # Always calls `expensive_function()`. + dict.get("key", expensive_function()) + # Calls `expensive_function()` only if the key does not exist. + dict.get("key") if dict.has("key") else expensive_function() + [/codeblock]