In the __init__
method, self refers to the newly created object; in other class methods, it refers to the instance whose method was called.
self, as a name, is just a convention, call it as you want ! but when using it, for example to delete the object, you have to use the same name: __del__(var)
, where var
was used in the __init__(var,[...])
You should take a look at cls
too, to have the bigger picture. This post could be helpful.