Python double underscore mangling
Name mangling occurs during the evaluation of a class statement. In the case of Bar, the __cache attribute is not defined as part of the class, but rather added to a specific object after the fact. (Actually, that may not be entirely correct. Name mangling may occur during the evaluation of the __new__ method; I … Read more