Newsgroups: comp.lang.python
Followup-To: comp.lang.python
From: Peter Otten <__pete...@web.de>
Date: Fri, 17 Jul 2009 08:58:40 +0200
Local: Fri, Jul 17 2009 2:58 am
Subject: Re: Override a method but inherit the docstring
Ben Finney wrote: Just thinking aloud: Write a patch for pydoc that looks up the base-class > Howdy all, > The following is a common idiom:: > class FooGonk(object): > class BarGonk(FooGonk): > The docstring for ‘FooGonk.frobnicate’ is, intentionally, perfectly > Ideally there would be a way to specify that the docstring should be > class BarGonk(FooGonk): > but that violates DRY (the association between BarGonk and FooGonk is > What is the most Pythonic, DRY-adherent, and preferably least-ugly documentation. B.f.__doc__ will continue to return None, but help(B.f) will show something like No documentation available for B.f. Help for A.f: Of course that might be misleading when A.f and B.f are up to something Peter You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||