+ 2

Why we use self in python

I didn't know much about it

10th Sep 2017, 4:09 AM
Ankit
Ankit - avatar
2 odpowiedzi
+ 8
It can be anything, not just 'self' - it's just a convention to use self to be coherent worldwide. Anyhow, the idea is that the first argument of a class instance method, when defining, refers to the particular object itself.
10th Sep 2017, 5:50 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar