Hacker News new | ask | show | jobs
by rpedroso 4079 days ago
If you want to enforce this more stringently, you can even prefix methods with __ (double underscore). Python will mangle the name:

    __mydef -> _myClass__mydef
You can, of course, still access the method, but it's very useful for keeping implementation details of a base class out of a subclass. This way, your subclass can have its own `mydef` without overriding the base class.