+ 2
Please explain what is @staticmethod and @classmethod in python
2 Antworten
+ 4
A regular method has 'self' as implicit first argument. This is the instance, that's supposed to be available in the method.
With class methods, the class is instead passed.
With static methods, nothing is passed. They behave like regular functions, only that they are in a class.