Dictionary in singleton gets copied on write in script despite docs saying otherwise

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By hello_world

Godot 3.1

For some strange reason my dictionary from singleton that I need to modify gets COWed in script. I’ve checked documentation and it clearly states that dictionaries are shared (GDScript reference — Godot Engine (latest) documentation in English).
I’ve tried accessing dictionary with onready var key = global.data['key'] as well as onready var key = get_node("/root/global").data['key']but when code hits the key = 'variable' my dictionary simply gets copied.

tl;dr Do I have to use setter/getter to modify dictionary in a singleton or am I missing something?

Same issue here :c

Athrosus | 2021-04-03 22:24