Why am I adding in self parameters into my functions in classes?
self is an obligatory parameter in all of your Python functions. It references the object being called, and I’ve seen this example which I really like:
class Example: def some_method(self): print('hello world'); example = Example() example.some_method() Example.some_method(example)
In the first time the method is called, Python automatically passes the
example object as the
self parameter. The second time I call it, I’m calling it on the class and passing the
example object as the self parameter.
Hope this helps!