I understand that self allows a method to act on specific data member of a class instance, but why is it necessary that self is included as a function parameter? Why is it not just a keyword like 'this' in C++?
Asked
Active
Viewed 43 times
1 Answers
3
It's just a personal preference of the language designer. Neither way is more correct than the other. But Python tends toward making things explicit, so you see design decisions tilting in this direction.

John Zwinck
- 239,568
- 38
- 324
- 436