Open adapap opened 4 years ago
Will there be a way to differentiate a static method from a class method? Nobody would want, e.g., Sound.play() to behave weirdly because it's not tied to an instance which defines what sound should play.
If you mean semantically, yes. The above is just an example of a scenario where a static method could be used. Adapting Python's grammar of @staticmethod
is one option of a noticeable difference. Right now I am leaning toward a static
keyword in front of method definitions.
In the following example,
Success
can be a static method allowing usage asSound.Success()
: