New submission from Nick Craig-Wood n...@craig-wood.com:
I just spend a while tracking down a bug in my code which turned out to be an
unexpected behaviour of hasattr.
Running this
class Test(object):
def __init__(self):
self.__private = Hello
def test(self):
R. David Murray rdmur...@bitdance.com added the comment:
You are correct, this is the expected behavior. Name mangling happens only at
compilation time (see
http://docs.python.org/reference/expressions.html#atom-identifiers). A doc
note for get/setattr would probably be useful.
(I removed