The problem: I have a class which contains a template method "execute" which calls another method "_execute". Subclasses are supposed to overwrite "_execute" to implement some specific functionality. This functionality should naturally be documented in the docstring of "_execute". I also expect users to create their own subclasses to extend the library. However, another user dealing with such a subclass should only use "execute", so he won't see the correct docstring if he uses "help(...)" in the interpreter.
Therefore it would be nice to modify the base class in such a way that in a subclass the docstring of "execute" is automatically replaced with that of "_execute". Any ideas how this might be done?
I was thinking of metaclasses to do this, to make this completely transparent to the user. I guess this approach applies to many places where the template pattern is used in Python.
Thanks!