Cls vs. Self: Understanding Method Types in Python
Have you ever wondered why some methods in Python receive the self keyword as a parameter, others cls and others nothing at all? In simple terms, it comes down to method types. self is used to access an instance method, cls is used to access a class method and nothing is applied when it’s a static