What does a method decorated with @classmethod receive as its first argument?
Correct answer
B. The class itself (cls)
19 views
B. The class itself (cls)
19 views
Class methods are often used as alternative constructors, such as Date.from_string(). Static methods receive no automatic first argument.
Asked in: NTS, Python Developer Interviews
Not sure why the answer is B? Ask here and get an explanation.