Will Godot have this kind of Python style variable swapping in the future?
Like this, maybe:
var a = 30
var b = 20
print("Before a: ", a, " and b: ", b);
a, b = b, a;
print("After a: ", a, " and b: ", b);
Actual behaviour: error(4, 3): Expected end of statement after expression.
Actually I expected GDScript to have at least swap method at global scope so it doesn't necessarily have to be like in Python:
var a = 30
var b = 20
swap(a, b)
This would also break other functions with swap name used in projects.
Duplicate of #7584?
Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.
The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.
If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!
Most helpful comment
Actually I expected GDScript to have at least
swapmethod at global scope so it doesn't necessarily have to be like in Python:This would also break other functions with
swapname used in projects.