[Python-ideas] inheriting docstrings

Jan Kaliszewski zuo at chopin.edu.pl
Sat Jun 11 14:09:07 CEST 2011


Probably better names...
> class MyDict(dict):
>> @functools.basedoc(dict)
> def __setitem__(self, key, value):
> super(dict, self).__setitem__(key, value)
> ...

'docfrom' instead of 'basedoc'
or maybe:
'inheritingdoc' or 'derivdoc'?
> @functools.superdocs # for methods without docstrings
> class MyDict(dict):
>> def __setitem__(self, key, value):
> super(dict, self).__setitem__(key, value)
> ...

'docfromsuper' instead of 'superdocs'
Cheers.
*j


More information about the Python-ideas mailing list

AltStyle によって変換されたページ (->オリジナル) /