Newsgroups: comp.lang.python
From: Jean-Michel Pichavant <jeanmic...@sequans.com>
Date: Mon, 27 Jul 2009 16:05:11 +0200
Local: Mon, Jul 27 2009 10:05 am
Subject: Re: Override a method but inherit the docstring
Ben Finney wrote: I am using epydoc and if the docstring is present only in the baseclass > 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 method, it will repeat the docstring for the child methods. So basically, there's nothing to do. I've also tried within the python interpreter, and it can perfectly solve docstring inheritance. So why would you explicitly assign docstring to child methods ? JM 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.
| ||||||||||||||