@staticmethod vs @classmethod in Python

In this course we’ll discuss the difference between the @staticmethod and @classmethod decorators as well as their uses in Python. We cover a few examples on when to best use each, and how to deal with each when using subclasses.

About Mahdi Yusuf

Mahdi Yusuf Mahdi Yusuf

Mahdi is the CTO of Gyroscope, the co-founder of the PyCoder’s Weekly, and a longtime Pythoneer.

» More about Mahdi

Each tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:

« Browse All Courses