The ____ function in the functools module is used to transform a method into a class method decorator.
- classmethod
- decorator
- method2class
- staticmethod
The classmethod function in the functools module is used to transform a method into a class method decorator. Class methods can be called on the class itself rather than on instances of the class.
Loading...
Related Quiz
- How can you reload a module that has been modified after it was initially imported?
- What would be the best sorting algorithm to use if you are concerned about worst-case time complexity?
- What would be the best data structure to implement a priority queue?
- You are reviewing a piece of code where the developer imported the numpy library as np and the pandas library as pd. These are examples of what concept in Python?
- Which loop is most appropriate when the number of iterations is known beforehand?