Pattern: cls
not as first argument of classmethod
Issue: -
The first argument of a class method is a reference to the current class. It is usually called cls
. The cls
name is used to easily differentiate class methods from instance methods.
Example of incorrect code:
def from_httplib(ResponseCls, r, **response_kw):
Example of correct code:
def from_httplib(cls, r, **response_kw):