What is the difference classmethod and staticmethod? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the difference classmethod and staticmethod?

21st Dec 2021, 10:49 AM
maryam el issati
2 Answers
+ 2
Class Method: Takes reference to class (cls) instead of an instance (self) Static Method: You call it like a normal function ClassName.StaticMethod() without instantciating
21st Dec 2021, 12:18 PM
William M
William M - avatar