GDScript: access level for class method and class variable#98606
GDScript: access level for class method and class variable#98606zjin123 wants to merge 9 commits intogodotengine:masterfrom
Conversation
|
This is a superseding pr of #98136 as well, with extra stuff and access levels implemented. |
Thanks for pointing out. I will fix the name. |
|
Any ideas what's happening with this? Have there been any consensus from the Godot team? |
Months ago I made an unofficial vote in contributors chat about in which approach the access restriction would be more preferred to be implemented. The result was that most voters preferred adding soft restriction than this pr. However, how to implement access restriction is still a topic in discussion and perhaps there will be a final decision from them after 4.4 stable will be released. |
|
Seems the issue this proposes to solve is the only existing proper encapsulation implementation that follows conventions by other languages with best OO practices, with optional warning and that already requires static typing. There are at least a dozen of related issues proving this is a very valuable and clearly wanted feature that is very spread with varying opinions and approaches that will probably never be implemented if it keeps like this. Soft implementations or annotation only may be worse than no implementation at all. The underscore that is currently the 'workaround' already has these three subjectively bizarre choices (private function / variable, to be overridden also suppress unused). Encapsulation will already only be used for projects that actually need it by people that minimally understand what they're doing, there is no need for an in between. Soft or annotation implementation PRs: |
Closes godotengine/godot-proposals#11039