Python class method(self)

In Python programming, self is used in instance methods, cls is often used in class methods. cls is generally used in the __new__ special staticmethod, or in classmethods, which you make similarly to staticmethods. These are methods that only need access to the class, but not to things specific to each instance of the class. Read More…


Python del self statement

Python del self does almost nothing it only deletes the local variable that is named self. Calling __del__ manually also achieves nothing except for running that method; it doesn’t delete anything. What does ‘del self.self ‘ in an __init__ function mean? The del self.self simply removes the unwanted self attribute on the object named by Read More…