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


Groups > comp.lang.python > #9506

Re: Proposal to extend PEP 257 (New Documentation String Spec)

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.134.4.91.MISMATCH!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <mhrivnak@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'string.': 0.04; 'args': 0.05; '"""': 0.07; 'forcing': 0.07; 'marking': 0.07; 'pep': 0.07; 'url:community': 0.07; 'python': 0.08; 'derived': 0.09; 'folks,': 0.09; 'introduces': 0.09; 'lately': 0.09; 'newline': 0.09; 'parsing': 0.09; 'sub': 0.09; 'tkinter': 0.09; 'url:peps': 0.09; 'syntax': 0.11; 'float': 0.13; 'wrote:': 0.15; '*args):': 0.16; 'arguments:': 0.16; 'clobber': 0.16; 'defer': 0.16; 'hammer': 0.16; 'identifiers.': 0.16; 'integer.': 0.16; 'internal:': 0.16; 'partly': 0.16; 'rantingrick': 0.16; 'subject:PEP': 0.16; 'underscore': 0.16; 'url:sigs': 0.16; '\xa0def': 0.16; '\xa0this': 0.16; '\xa0to': 0.16; 'folks': 0.16; 'method.': 0.16; 'why.': 0.16; 'cc:addr:python-list': 0.16; 'pm,': 0.16; 'def': 0.16; 'language': 0.20; 'cc:2**0': 0.21; 'community,': 0.22; 'is?': 0.22; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'referring': 0.23; 'wonder': 0.23; 'interface': 0.23; 'code': 0.24; 'handles': 0.25; 'string': 0.26; 'sender:addr:gmail.com': 0.26; 'specifically': 0.26; 'tried': 0.27; 'url:mailman': 0.27; 'thu,': 0.28; 'message-id:@mail.gmail.com': 0.28; '(even': 0.29; 'problem': 0.29; 'skip:- 30': 0.30; 'cc:addr:python.org': 0.30; 'classes': 0.30; 'module': 0.30; 'new.': 0.30; 'skip:{ 20': 0.30; 'strings.': 0.30; 'url:dev': 0.30; 'class': 0.31; 'least': 0.31; 'separate': 0.31; 'user.': 0.31; 'url:listinfo': 0.32; 'michael': 0.32; 'proposed': 0.32; 'too': 0.32; 'typically': 0.33; 'implement': 0.33; 'people,': 0.33; "i've": 0.33; 'there': 0.34; 'realize': 0.34; 'doc': 0.35; 'integer': 0.35; 'probably': 0.35; 'idea': 0.36; 'rules': 0.36; 'url:python': 0.37; 'useful': 0.37; 'functions.': 0.37; 'some': 0.37; 'languages': 0.37; 'but': 0.37; 'using': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'url:org': 0.38; 'subject:: ': 0.38; '8bit%:8': 0.38; 'created': 0.38; '8bit%:5': 0.38; 'comments': 0.38; 'growing': 0.38; 'should': 0.39; 'unlike': 0.39; 'received:209': 0.40; 'did': 0.40; 'methods': 0.40; 'your': 0.60; 'tag': 0.64; 'here': 0.66; 'believe': 0.66; 'received:209.85.215.174': 0.67; 'received:mail- ey0-f174.google.com': 0.67; 'refusing': 0.67; 'placed': 0.72; 'gift': 0.77; '257': 0.84; 'battle': 0.84; 'boxes.': 0.84; 'defeat': 0.84; 'lays': 0.84; 'style!': 0.84; 'spec': 0.91; 'subject:Proposal': 0.93; 'arise': 0.96
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Stru7M5cXdZa20gUa5UBce0u20o8CS9W+9tLvkpUlH4=; b=ZQMkjiF15Wkdio9DVLwPrs4ahItFmG3EWktYN2g8U1GBEcbDB0nxsmcaYfGNdV8O+D aMBtz9IbOkEb3B8esLVZY0L52ge73GDRDg20JC+XkhSw4yzXESWf6y956YmIE9ef1U7m mpG62sWMAICyWRhdhSpbG+FOYqxZ2grtu/XUY=
MIME-Version 1.0
Sender mhrivnak@gmail.com
In-Reply-To <120629e8-3b37-4e8c-a472-cd361de15de4@g9g2000yqb.googlegroups.com>
References <120629e8-3b37-4e8c-a472-cd361de15de4@g9g2000yqb.googlegroups.com>
Date Fri, 15 Jul 2011 02:00:29 -0400
X-Google-Sender-Auth h0sn5X1PxfdWJBYHYIpOPOdcAXI
Subject Re: Proposal to extend PEP 257 (New Documentation String Spec)
From Michael Hrivnak <mhrivnak@hrivnak.org>
To rantingrick <rantingrick@gmail.com>
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.1043.1310709630.1164.python-list@python.org> (permalink)
Lines 166
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1310709630 news.xs4all.nl 23855 [2001:888:2000:d::a6]:58103
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:9506

Show key headers only | View raw


Was tried at least once before:
http://www.python.org/dev/peps/pep-0287/

Check in here with your ideas:
http://www.python.org/community/sigs/current/doc-sig/

Have any other languages mandated the use of a specific documentation markup?

Michael

On Thu, Jul 14, 2011 at 7:02 PM, rantingrick <rantingrick@gmail.com> wrote:
>
> Hello Folks,
>
> Lately i have been musing over the ideas of method tagging.
> Specifically i am referring to method identifiers. As most of you know
> i had proposed to add "syntactical markers" to the language to deal
> with the ambiguities that arise whist eyeball parsing sub classed
> methods that clobber virtual methods. HOWEVER that idea caused some
> fierce controversy within the community, and i can partly understand
> why.
>
> Although i strongly believe in proper documentation (even to the point
> of forcing syntax on folks) i understand that we cannot implement such
> a thing without major growing pains. So with that being said, i have
> formulated a new battle plan to defeat this problem of ambiguity.
>
> Unlike most languages out there we have doc-strings; and do we realize
> how great this gift is? Sometimes i wonder because you folks should
> really be using them like they are going out of style!
>
> As we all know PEP 257 lays out some ground rules for documentation
> strings HOWEVER i feel this PEP did no go far enough. Too many folks
> are refusing to document properly and so i will take this time to
> hammer out a spec. I would like to comments for or against.
>
> ---------------------------------------
>  New Syntax Specification For Documentation Strings
> ---------------------------------------
>
> """ {DOC TAG HERE}: {MODULE_NAME|SHORT_SUMMARY_HERE}.
> {NEWLINE}
> {LONG_DESCRIPTION_HERE}
> {NEWLINE}
> Arguments: (if applicable)
>    {ARGUMNET_1} <{TYPE}>:
>        ARGUMENT_1_DESCRIPTION}
>    {ARGUMNET_2} <{TYPE}>:
>        ARGUMENT_2 DESCRIPTION}
>    {ARGUMNET_N} <{TYPE}>:
>        ARGUMENT_N_DESCRIPTION}
> {NEWLINE}
> """
>
> As you can see my spec introduces some new ideas to writing doc-
> strings. Specifically the "DOC TAG" and {ARG TYPES} are new. Also i've
> found it much more useful to separate args and their respective
> descriptions with a newline and indention.
>
> ---------------------------------------
>  Example: Module Documentation String.
> ---------------------------------------
>
> """Module <simpledialog.py>:
>
> This module handles Tkinter dialog boxes.
> It contains the following public symbols:
>
>    Dialog <class>:
>        A base class for dialogs.
>
>    askinteger <function>:
>        Get an integer from the user.
>
>    askfloat <function>:
>        Get a float from the user.
>
>    askstring <function>:
>        Get a string from the user.
>
> """
>
> I don't know how i feel about marking classes and functions since IF
> we follow the python style guide we don;t need to; but that's IF we
> FOLLOW it people, IF.
>
> ---------------------------------------
>  Example: Func/Meth Documentation String.
> ---------------------------------------
>
> def askinteger(parent, title, prompt, **kw):
>    """ Interface: Get an integer from the user.
>
>    Return value is an integer.
>
>    Arguments:
>        title <string>:
>            the dialog title
>        prompt <string|integer|float>:
>            the label text
>        **kw:
>            see SimpleDialog class
>
>
> ---------------------------------------
>  Example: Class Inheritance Documentation Strings.
> ---------------------------------------
>
> class Base():
>    def __init__(self):
>        """ Internal:"""
>        self.m1()
>
>    def m1(self, *args):
>        """Overide: """
>        pass
>
> class Derived(Base):
>    def __init__(self):
>        Base.__init__(self)
>
>    def _m1(self):
>        """ Internal: blah"""
>
>    def m1(self):
>        """ Clobbered: see Base for detail"""
>
>    def m3(self):
>        """ Interface: Blah"""
>
> ---------------------------------------
>  Tags For Documentation Strings
> ---------------------------------------
>
>  Module:
>    The module tag is to be used for module doc strings.
>
>  Virtual:
>    The virtual tag is for methods residing in a base class
>    that are created specifically to be overridden. Of course as we
>    all know every Python methods/function is virtual by default
>    however the point of this is to make the code more readable!
>
>  Override:
>    This tag should be placed in a derived class's method which has
>    clobbered a base method. Typically you can just defer the reader
>    to look up the base class for more info.
>
>  Internal:
>    This tag should be used on all internal methods (psst: the ones
> that
>    start with a single underscore *ahem* or SHOULD start with a
> single
>    underscore!).
>
>  Interface:
>    This tag is be used for interface method/function doc strings.
> This
>    is probably the most important tag. If you don't do any tagging AT
>    LEAST tag the interface methods and functions. However i must
>    remind you that all these tags are very important.
>
> --
> 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

Proposal to extend PEP 257 (New Documentation String Spec) rantingrick <rantingrick@gmail.com> - 2011-07-14 16:02 -0700
  Re: Proposal to extend PEP 257 (New Documentation String Spec) Ben Finney <ben+python@benfinney.id.au> - 2011-07-15 10:24 +1000
  Re: Proposal to extend PEP 257 (New Documentation String Spec) Michael Hrivnak <mhrivnak@hrivnak.org> - 2011-07-15 02:00 -0400
  Re: Proposal to extend PEP 257 (New Documentation String Spec) Chris Angelico <rosuav@gmail.com> - 2011-07-15 17:13 +1000
    Re: Proposal to extend PEP 257 (New Documentation String Spec) rantingrick <rantingrick@gmail.com> - 2011-07-15 11:56 -0700
      Re: Proposal to extend PEP 257 (New Documentation String Spec) Chris Angelico <rosuav@gmail.com> - 2011-07-16 09:16 +1000
        Re: Proposal to extend PEP 257 (New Documentation String Spec) rantingrick <rantingrick@gmail.com> - 2011-07-16 08:32 -0700
          Re: Proposal to extend PEP 257 (New Documentation String Spec) Chris Angelico <rosuav@gmail.com> - 2011-07-17 02:25 +1000
          Re: Proposal to extend PEP 257 (New Documentation String Spec) Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-16 18:03 -0500
            Re: Proposal to extend PEP 257 (New Documentation String Spec) rantingrick <rantingrick@gmail.com> - 2011-07-16 16:25 -0700
              Re: Proposal to extend PEP 257 (New Documentation String Spec) Chris Angelico <rosuav@gmail.com> - 2011-07-17 09:45 +1000
          Re: Proposal to extend PEP 257 (New Documentation String Spec) Andrew Berg <bahamutzero8825@gmail.com> - 2011-07-16 18:44 -0500
      Re: Proposal to extend PEP 257 (New Documentation String Spec) Michael Hrivnak <mhrivnak@hrivnak.org> - 2011-07-16 15:23 -0400
        Re: Proposal to extend PEP 257 (New Documentation String Spec) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-17 13:10 +1000
          Re: Proposal to extend PEP 257 (New Documentation String Spec) Tim Chase <python.list@tim.thechases.com> - 2011-07-17 06:11 -0500
            Re: Proposal to extend PEP 257 (New Documentation String Spec) rantingrick <rantingrick@gmail.com> - 2011-07-17 10:30 -0700
      Re: Proposal to extend PEP 257 (New Documentation String Spec) Chris Angelico <rosuav@gmail.com> - 2011-07-17 09:09 +1000
  Re: Proposal to extend PEP 257 (New Documentation String Spec) George Rodrigues da Cunha Silva <georger.silva@gmail.com> - 2011-07-15 12:44 -0300

csiph-web