diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 79fbfff175..6753398cf6 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -255,6 +255,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]