+ 1

Is "self" a keyword in python?

I have tried changing "self" (key)word to something else and it worked. if, we can use any word , why everyone stick to SELF?

28th Jul 2017, 4:23 AM
Harish M
Harish M - avatar
1 Resposta
+ 6
Just by convention, for code readability. You can indeed replace it with any other non-reserved word.
28th Jul 2017, 4:46 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar