>Name mangling is there to keep you from accidentally hiding such an >attribute in a subclass, but how often is this really a danger? Can >someone give me an example of where __-mangling really solved a problem >for them, where a simple leading underscore wouldn't have solved the >same problem?
Look at the "autosuper" implementation on Guido's descrintro paper; there the fact that you user __super instead of _super is essential. However I have written tens of thousands of lines of Python code and never needed __protected variables except in a few experimental scripts for learning purpose. So I agree that the need does not occur often, but it is still an useful thing to have. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list