godotengine / godotengine/godot-docs
One step vs two step builtin in a container modification is not equivalent
- Dominant language
- reStructuredText
- Stars
- 5.7k
- Forks
- 3.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 25
Description
Sorry for the obscure title, here is a snippet that would explain much better:
```GDscript
var a = [Vector2()]
a[0].x = 42
var b = a[0]
b.x = 43
print(a) # Returns [Vector2(42, 0)]
# Same behavior with Dictionary and Pool*Array :'-(
```
I've encountered this behavior while working on Godot-Python (see https://github.com/touilleMan/godot-python/issues/93 for a more in-depth explanation of the reason of this behavior).
I'm not sure this behavior has to be corrected (I would guess the cost would be high given it deals with internal implementation of containers and I didn't see other issue about this...). However we could add a line about this exotic thing in the GDscript documentation when talking about containers.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.