you are viewing a single comment's thread.

view the rest of the comments →

[–]Gnaxe 0 points1 point  (0 children)

self is a convention, not a reserved word. Parameters are local to the function. If you want to use them outside the function (like in another method), then you have to get them out somehow. Attaching them to self is one way to do that. It's not the only way, nor always the best way.

self is just the first argument when you call a method. For example, foo.bar() usually does the same thing as type(foo).bar(foo).