summaryrefslogtreecommitdiff
path: root/doc/classes/Dictionary.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/Dictionary.xml')
-rw-r--r--doc/classes/Dictionary.xml8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml
index 385f4b7e59..5413fa33c6 100644
--- a/doc/classes/Dictionary.xml
+++ b/doc/classes/Dictionary.xml
@@ -126,6 +126,13 @@
</argument>
<description>
Returns [code]true[/code] if the dictionary has a given key.
+ [b]Note:[/b] This is equivalent to using the [code]in[/code] operator as follows:
+ [codeblock]
+ # Will evaluate to `true`.
+ if "godot" in {"godot": "engine"}:
+ pass
+ [/codeblock]
+ This method (like the [code]in[/code] operator) will evaluate to [code]true[/code] as long as the key exists, even if the associated value is [code]null[/code].
</description>
</method>
<method name="has_all">
@@ -148,6 +155,7 @@
# The line below prints `true`, whereas it would have printed `false` if both variables were compared directly.
print(dict1.hash() == dict2.hash())
[/codeblock]
+ [b]Note:[/b] Dictionaries with the same keys/values but in a different order will have a different hash.
</description>
</method>
<method name="keys">