Calling private base methods

Duncan Booth duncan.booth at invalid.invalid
Thu Apr 12 07:04:33 EDT 2007


"7stud" <bbxx789_05ss at yahoo.com> wrote:

> On Apr 12, 2:47 am, "Jorgen Bodde" <jorgen.maill... at gmail.com> wrote:
>> Is it possible to call a private base method? I come from a C++
>> background, and I liked this construction as my base class has helper
>> methods so that I do not have to  duplicate code.
>>
> 
> I'd like to see some C++ code that does that!
> 
> 

Easy:

#define private public
#include <someheader>
#undef private

then call the private methods as much as you want.



More information about the Python-list mailing list