how to inherit docstrings?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Jun 10 05:48:40 EDT 2011


On Thu, 09 Jun 2011 23:59:08 -0400, Terry Reedy wrote:

> On 6/9/2011 9:12 PM, Carl Banks wrote:
> 
>> Presumably, the reason you are overriding a method in a subclass is to
>> change its behavior; I'd expect an inherited docstring to be inaccurate
>> more often than not.  So I'd be -1 on automatically inheriting them.
>>
>> However, I'd be +1 easily on a little help from the language to
>> explicitly request to inherit the docstring.
> 
> An empty docstring "" could be interpreted as 'ditto' ;-) It would be
> useless otherwise.

+1

Better than an decorator!



-- 
Steven



More information about the Python-list mailing list