Why do pythonistas call the current reference “self” and not “this”?

后端 未结 8 1686
终归单人心
终归单人心 2020-12-13 12:13

Python is the language I know the most, and strangely I still don\'t know why I\'m typing \"self\" and not \"this\" like in Java or PHP.

I know that Python is older

8条回答
  •  萌比男神i
    2020-12-13 13:04

    Python follows Smalltalk's footsteps in the aspect - self is used in Smalltalk as well. I guess the real question should be 'why did Bjarne decide to use this in C++'...

提交回复
热议问题