0

When to use @staticmethod ?

What is the advantage of using @staticmethod over normal method inside the same class? Why do we need it ? I ran the same segment of code without @staticmethod, didn't create any difference, Any Suggestons. [a sample code will be better to understand]

28th Apr 2020, 2:37 PM
Aanzil Akram Halsana
Aanzil Akram Halsana - avatar
1 Answer
0
Static method allows you to call a method without creating an instance of a class ,so that means you don't need to place self keyword as well when defining that method
28th Apr 2020, 9:01 PM
Abhay
Abhay - avatar