I want to know if there is a memory advantage when using this kind of method, decorated with @staticmethod and @classmethod. It could be useful when instantiating several objects of a class.
No method is defined more than once anyway, even without any decorator. Write what you mean. Only worry about memory optimisation if you have an indication that it's a problem.
instances of classes in Python do not carry around copies of the methods that exist in the class. Those function objects belong to the class. So, vars(some_instance) will show you instance attributes, but you'll see, the methods aren't there.
Thanks all for the feedback and help. I already knew the purpose of static methods and class methods, I only wanted to know the memory treatment at a low level, but with your answers it is clear.
vars(some_instance)will show you instance attributes, but you'll see, the methods aren't there.