+ 2

What is Self in python ?

It's working like this pointer according to other languages like java or c++

26th Feb 2018, 5:33 PM
Azeem Ghafoor
Azeem Ghafoor - avatar
1 Odpowiedź
+ 2
By convention, this argument is always named self. In the init method, self refers to the newly created object; in other class methods, it refers to the instance whose method was called.
26th Feb 2018, 5:33 PM
Azeem Ghafoor
Azeem Ghafoor - avatar