+ 1

What is the 'self' keyword used for?

Python Self Keyword

16th Mar 2017, 5:13 PM
Filipe Bispo Lima
Filipe Bispo Lima - avatar
5 Respuestas
+ 11
See SoloLearn's Python course > Object oriented programming > Class, lesson 2: 'All methods must have self as their first it isn't explicitly passed, Python adds the self argument to the list for you; you do not need to include it when you call the methods. Within a method definition, self refers to the instance calling the method.'
16th Mar 2017, 6:24 PM
Tashi N
Tashi N - avatar
+ 6
The self keyword is like the 'this' keyword in other programming languages.
17th Mar 2017, 12:33 AM
Ulisses Cruz
Ulisses Cruz - avatar
+ 2
For object-oriented programming.
16th Mar 2017, 6:11 PM
NickBossBG
NickBossBG - avatar
+ 1
self keyword is used for refering object wich implemented by a class.
16th Mar 2017, 7:21 PM
Jessie
Jessie - avatar
0
the self keyword is used in Python to access on the current object inside the class
17th May 2017, 5:41 PM
Jessie
Jessie - avatar