I am doing the python koan (for python 2.6) and ecnountered something I don't understand. One of the files has the following code in line 160:
class Dog(object):
def __password(self):
return 'password'
This
rover = Dog()
password = rover.__password()
results in an AttributeError
. That is clear to me. (__password(self)
is some kind of private method because of the leading two underscores).
But this
rover._Dog__password()
is a mystery to me. Could some one please explain to me how or why this works or better point me to the docs where this is described?