The first parameter of a class method (including certain special methods such as __new__), or a method of a metaclass, should be named cls.

Ensure that the first parameter of class methods is named cls, as recommended by the style guidelines in PEP 8.

In the following example, the first parameter of the class method make is named self instead of cls.

  • Python PEP 8: Function and method arguments.
  • Python Tutorial: Classes.
  • Python Docs: classmethod.