Consider the following code:
from module import some_function
class SomeClass:
@staticmethod
def class_function(*args, **kwargs):
return some_function(*args, **kwargs)
The static method is simply an class wrapper to module.some_function. Why can't I do this with simple variable assignment.
from module import some_function
class SomeClass:
class_function = some_function
Now, class_function is no longer a staticmethod, and also the decorator can't be used. Is there a way around this?
Cheers.