What is the difference between a function decorated with @staticmethod and one decorated with @classmethod?
A quick hack-up ofotherwise identical methods in iPython reveals that @staticmethod
yields marginal performance gains (in the nanoseconds), but otherwise it seems to serve no function. Also, any performance gains will probably be wiped out by the additional work of processing the method through staticmethod()
during compilation (which happens prior to any code execution when you run a script).
For the sake of code readability I'd avoid @staticmethod
unless your method will be used for loads of work, where the nanoseconds count.