[issue8264] hasattr doensn't show private (double underscore) attributes exist

2010-03-30 Thread Nick Craig-Wood
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):

[issue8264] hasattr doensn't show private (double underscore) attributes exist

2010-03-30 Thread R. David Murray
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