Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7348

Re: how to inherit docstrings?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ericsnowcurrently@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'string.': 0.04; 'sure.': 0.05; 'behavior,': 0.07; 'terry': 0.07; 'clearly,': 0.09; 'subclass': 0.09; 'pm,': 0.10; ';-)': 0.14; 'wrote:': 0.14; 'activated.': 0.16; 'docstring': 0.16; 'inherited': 0.16; 'inheriting': 0.16; 'presumably,': 0.16; 'reedy': 0.16; 'uncommon': 0.16; 'cc:addr:python-list': 0.17; 'language': 0.18; 'guess': 0.19; 'jan': 0.20; 'header:In-Reply-To:1': 0.21; 'thu,': 0.22; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; 'interpreted': 0.23; '\xa0so': 0.23; 'expect': 0.25; 'url:mailman': 0.26; 'not.': 0.26; 'message-id:@mail.gmail.com': 0.28; 'otherwise.': 0.29; 'subject:how': 0.29; 'subject:?': 0.29; 'explicitly': 0.29; 'cc:addr:python.org': 0.30; 'url:listinfo': 0.30; 'carl': 0.30; 'implicitly': 0.30; 'received:209.85.215': 0.30; 'useless': 0.30; 'it.': 0.31; 'cases': 0.32; 'someone': 0.33; 'however,': 0.34; 'there': 0.35; 'idea': 0.36; 'received:google.com': 0.37; 'change': 0.37; 'received:209.85': 0.37; 'pretty': 0.37; 'url:python': 0.38; 'could': 0.38; 'url:org': 0.38; 'but': 0.38; 'subject:: ': 0.38; "i'd": 0.39; 'received:209': 0.39; 'empty': 0.39; 'help': 0.40; 'easily': 0.60; 'more': 0.60; 'kind': 0.60; 'your': 0.60; 'easily,': 0.73
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FUqGH38Vn0hxVpkGXYpb7ZIBlFJnbSY+xB9jZRgzghA=; b=Ey6OcVciLDrynRXk+OF4CjMref52ynYkO8dN9CxGOGsQNtM3+qpFa8UG5UzRnVH68c IlnHYjDn9Y2QiV/GMU4232l7OPQ/ojFw7o/IPz3nObwrVWgqNL2qAxtnH5Nhu9vOsNQ9 ttqtwB9i+NjizHQB7wiyageHGREVs5EWtN8zQ=
DomainKey-Signature a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=RhAmT99uCMjg7dxwEvS/zl+rNha1oB3/KtNo9n/NMIeD5Q6aEZPKk6vrDMaN0SjNdG +GR0wEQcNy5Y4nIcRzqGd7uOZrG6B/Qu56e+m54RHEA0mmzwJOFnMdmDoaIDXGBkTEnw 32dvPEuYOIuxtWbXWv7ShW2Xm+puUQaqadWtM=
MIME-Version 1.0
In-Reply-To <iss4qb$139$2@dough.gmane.org>
References <95cvmqF5b0U1@mid.individual.net> <b5497fa4-b79b-454e-b2e1-9e48642e2d85@glegroupsg2000goo.googlegroups.com> <iss4qb$139$2@dough.gmane.org>
Date Thu, 9 Jun 2011 22:41:12 -0600
Subject Re: how to inherit docstrings?
From Eric Snow <ericsnowcurrently@gmail.com>
To Terry Reedy <tjreedy@udel.edu>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.75.1307680873.11593.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 82.94.164.166
X-Trace 1307680874 news.xs4all.nl 49047 [::ffff:82.94.164.166]:48495
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:7348

Show key headers only | View raw


On Thu, Jun 9, 2011 at 9:59 PM, Terry Reedy <tjreedy@udel.edu> 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.
>

I kind of like that.  The only catch is for cases out there where
someone used an empty string.  Then it would change the behavior,
maybe.  But how uncommon that is, not sure.  I would guess pretty
uncommon.

Whole implicitly inherit idea would require the empty docstring to say
don't do it.  With your idea you easily, clearly, and explicitly
indicate that you want the inheritance activated.  That would work for
me.

-eric

> --
> Terry Jan Reedy
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: how to inherit docstrings? Carl Banks <pavlovevidence@gmail.com> - 2011-06-09 18:12 -0700
  Re: how to inherit docstrings? Ben Finney <ben+python@benfinney.id.au> - 2011-06-10 11:42 +1000
  Re: how to inherit docstrings? Eric Snow <ericsnowcurrently@gmail.com> - 2011-06-09 20:37 -0600
  Re: how to inherit docstrings? Terry Reedy <tjreedy@udel.edu> - 2011-06-09 23:59 -0400
    Re: how to inherit docstrings? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-10 09:48 +0000
  Re: how to inherit docstrings? Eric Snow <ericsnowcurrently@gmail.com> - 2011-06-09 22:41 -0600
  Re: how to inherit docstrings? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-06-10 19:16 +1200

csiph-web