[Python-ideas] inheriting docstrings and mutable docstings for classes
greg.ewing at canterbury.ac.nz
Fri Jun 10 09:04:32 CEST 2011
Nick Coghlan wrote:
> -1. Subclasses are not the same thing as the original class so
> docstring inheritance should be requested explicitly.
The docstring of the class itself probably shouldn't be
inherited automatically. But if you override a method
without changing the API or user-visible behaviour, the
inherited docstring still applies.
Maybe the best thing would be for the inherited docstring
to get put into a different property, such as __basedoc__.
Then tools that examine docstrings can decide for themselves
whether using inherited docstrings makes sense.
More information about the Python-ideas