godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.87k stars 3.16k forks source link

Document that Dictionary keys can be any type including arrays and dictionaries. #4395

Open me2beats opened 3 years ago

me2beats commented 3 years ago

Your Godot version: 3.2.3

Issue description: Having mostly Python background, I did not expect that godot dictionary keys can be dictionaries and arrays. In Python dicts and lists are unhashable. I think it would be useful to know when learning Godot.

URL to the documentation page (if already existing):

Calinou commented 3 years ago

As far as I know, any Variant type can be a dictionary key. However, values that are passed by reference may behave unexpectedly (tread carefully).