Avatar ·

Why do python need @staticMethod

📁 декоратор, метод, python, ии

there is a class printer . He has 2 methods that do the same. The difference is that one of the methods is with a decorator @staticMethod , and the other - without. But I can call both methods without creating a class instance.

   class   ():   '' '' Test @StaticMethod '' '   def   not_static_print  ( self, text =  'Example Text'  ):   print  (Text)   @staticmethod    static_print  ( text =  '' example text ' ):   print  (text)  # class = ""> 'sense like this.' )     

just for not_static_print () I indicate a copy, or rather its absence ( none

Is there a fundamental difference in the use of these methods?