What do these mean of: @classmethod and @staticmethod

Total Post:57

Points:285
 551  View(s)
Ratings:
Rate this:
  1. Post:57

    Points:285
    What do these mean of: @classmethod and @staticmethod

    These are decorators. A decorator is a special kind of function that either takes a function and returns a function, or takes a class and returns a class. The @ symbol is just syntactic sugar that easy in read. 

    @my_decorator 
    def my_func(stuff):
        do_things
    def my_func(stuff):
    
        do_things
    my_func = my_decorator(my_func)

Answer