What is the difference between a class method and a static method in Python?

Python Developer Medium

Python Developer — Medium

What is the difference between a class method and a static method in Python?

Key points

  • @classmethod receives the class (cls) as the first argument
  • @staticmethod receives no implicit first argument
  • @staticmethod cannot access the class or instance

Ready to go further?

Related questions