Class method %s should have cls as first argument


Used when the first argument of a class method has a name other than cls.

This message belongs to the classes checker.


This message reports violations of the corresponding Python convention. The cls name is used to easily differentiate class methods from instance methods.

PEP 8: Function and Method Arguments states this convention:

Always use self for the first argument to instance methods.
Always use cls for the first argument to class methods.

For the corresponding message on instance methods, see E0213.

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License