Every single example I have seen of a method in a class in Python, has self as the first argument. Is this true of all methods? If so, couldn’t python have been written so that this argument was just understood and therefore not needed?
Every single example I have seen of a method in a class in Python,
Share
If you want a method that doesn’t need to access
self, usestaticmethod:If you want access to the class, but not to the instance, use
classmethod: