What was the rationale for choosing the name self
instead of this
when defining class methods in Python?
Yes, of course, you can name it whatever you want - but the widely agreed-upon name for the first parameter is very clearly self
.
I ask because there was an article about Robert Dewar explaining why :
was added to the end of block statement lines (e.g. if foo:
, def foo():
), where his wife, Karin, looked at it passively and mentioned it wasn't as readable without it. So I wondered if there would be a similar explanation for Guido or the Python community to choose self
over this
.