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: 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 To: rantingrick 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 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 marku= p? Michael On Thu, Jul 14, 2011 at 7:02 PM, rantingrick 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. > > --------------------------------------- > =A0New Syntax Specification For Documentation Strings > --------------------------------------- > > """ {DOC TAG HERE}: {MODULE_NAME|SHORT_SUMMARY_HERE}. > {NEWLINE} > {LONG_DESCRIPTION_HERE} > {NEWLINE} > Arguments: (if applicable) > =A0 =A0{ARGUMNET_1} <{TYPE}>: > =A0 =A0 =A0 =A0ARGUMENT_1_DESCRIPTION} > =A0 =A0{ARGUMNET_2} <{TYPE}>: > =A0 =A0 =A0 =A0ARGUMENT_2 DESCRIPTION} > =A0 =A0{ARGUMNET_N} <{TYPE}>: > =A0 =A0 =A0 =A0ARGUMENT_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. > > --------------------------------------- > =A0Example: Module Documentation String. > --------------------------------------- > > """Module : > > This module handles Tkinter dialog boxes. > It contains the following public symbols: > > =A0 =A0Dialog : > =A0 =A0 =A0 =A0A base class for dialogs. > > =A0 =A0askinteger : > =A0 =A0 =A0 =A0Get an integer from the user. > > =A0 =A0askfloat : > =A0 =A0 =A0 =A0Get a float from the user. > > =A0 =A0askstring : > =A0 =A0 =A0 =A0Get 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. > > --------------------------------------- > =A0Example: Func/Meth Documentation String. > --------------------------------------- > > def askinteger(parent, title, prompt, **kw): > =A0 =A0""" Interface: Get an integer from the user. > > =A0 =A0Return value is an integer. > > =A0 =A0Arguments: > =A0 =A0 =A0 =A0title : > =A0 =A0 =A0 =A0 =A0 =A0the dialog title > =A0 =A0 =A0 =A0prompt : > =A0 =A0 =A0 =A0 =A0 =A0the label text > =A0 =A0 =A0 =A0**kw: > =A0 =A0 =A0 =A0 =A0 =A0see SimpleDialog class > > > --------------------------------------- > =A0Example: Class Inheritance Documentation Strings. > --------------------------------------- > > class Base(): > =A0 =A0def __init__(self): > =A0 =A0 =A0 =A0""" Internal:""" > =A0 =A0 =A0 =A0self.m1() > > =A0 =A0def m1(self, *args): > =A0 =A0 =A0 =A0"""Overide: """ > =A0 =A0 =A0 =A0pass > > class Derived(Base): > =A0 =A0def __init__(self): > =A0 =A0 =A0 =A0Base.__init__(self) > > =A0 =A0def _m1(self): > =A0 =A0 =A0 =A0""" Internal: blah""" > > =A0 =A0def m1(self): > =A0 =A0 =A0 =A0""" Clobbered: see Base for detail""" > > =A0 =A0def m3(self): > =A0 =A0 =A0 =A0""" Interface: Blah""" > > --------------------------------------- > =A0Tags For Documentation Strings > --------------------------------------- > > =A0Module: > =A0 =A0The module tag is to be used for module doc strings. > > =A0Virtual: > =A0 =A0The virtual tag is for methods residing in a base class > =A0 =A0that are created specifically to be overridden. Of course as we > =A0 =A0all know every Python methods/function is virtual by default > =A0 =A0however the point of this is to make the code more readable! > > =A0Override: > =A0 =A0This tag should be placed in a derived class's method which has > =A0 =A0clobbered a base method. Typically you can just defer the reader > =A0 =A0to look up the base class for more info. > > =A0Internal: > =A0 =A0This tag should be used on all internal methods (psst: the ones > that > =A0 =A0start with a single underscore *ahem* or SHOULD start with a > single > =A0 =A0underscore!). > > =A0Interface: > =A0 =A0This tag is be used for interface method/function doc strings. > This > =A0 =A0is probably the most important tag. If you don't do any tagging AT > =A0 =A0LEAST tag the interface methods and functions. However i must > =A0 =A0remind you that all these tags are very important. > > -- > http://mail.python.org/mailman/listinfo/python-list >