Asked • 05/10/19

Meaning of @classmethod and @staticmethod for beginner?

Could someone explain to me the meaning of `@classmethod` and `@staticmethod` in python? I need to know the difference and the meaning. As far as I understand, `@classmethod` tells a class that it's a method which should be inherited into subclasses, or... something. However, what's the point of that? Why not just define the class method without adding `@classmethod` or `@staticmethod` or any `@` definitions?**tl;dr:** *when* should I use them, *why* should I use them, and *how* should I use them?I'm pretty advanced with C++, so using more advanced programming concepts shouldn't be a problem. Feel free giving me a corresponding C++ example if possible.

1 Expert Answer

By:

Christopher S. answered • 05/10/19

Tutor
5 (7)

Christo: Online programming and Computer Literacy tutor

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.