1.

What Is Self?

Answer»

SELF is merely a CONVENTIONAL name for the first ARGUMENT of a method. A method defined as meth(self, a, b, c) should be called as X.meth(a, b, c) for some instance x of the CLASS in which the definition occurs; the called method will think it is called as meth(x, a, b, c).

Self is merely a conventional name for the first argument of a method. A method defined as meth(self, a, b, c) should be called as x.meth(a, b, c) for some instance x of the class in which the definition occurs; the called method will think it is called as meth(x, a, b, c).



Discussion

No Comment Found