+ 1

why is used (self) in all functions of a class?

why is used (self) in all functions of a class?

17th May 2018, 6:19 PM
Almir
Almir - avatar
2 odpowiedzi
+ 2
It doesn’t need to be ‘self’ it can be anything, it’s just the norm. The first parameter of a method is always the object itself (self).
17th May 2018, 7:11 PM
TurtleShell
TurtleShell - avatar
+ 1
“Self” is calling to the specific object of a class.
17th May 2018, 7:03 PM
Eterxoz
Eterxoz - avatar