Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'attribute': 0.05; 'literal': 0.09; 'subject:Why': 0.09; 'subject:string': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'subject:not': 0.11; 'docstring': 0.16; 'empty.': 0.16; 'from:addr:miki.tebeka': 0.16; 'from:name:miki tebeka': 0.16; 'modules,': 0.16; 'subject:doc': 0.16; 'suite.': 0.16; 'string': 0.17; 'wrote:': 0.17; 'string,': 0.17; 'thanks,': 0.18; '>>>': 0.18; 'statement': 0.23; 'cc:addr:python.org': 0.25; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'thanks!': 0.26; 'cc:addr:gmail.com': 0.27; 'wonder': 0.27; 'cc:2**2': 0.27; 'received:209.85.212': 0.28; '>>>>': 0.29; 'source': 0.29; 'class': 0.29; 'classes': 0.30; 'received:google.com': 0.34; 'pm,': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'cc:no real name:2**1': 0.36; 'itself': 0.37; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'some': 0.38; 'first': 0.61; 'received:209.85.212.56': 0.91 Newsgroups: comp.lang.python Date: Tue, 21 Aug 2012 10:40:04 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=75.82.8.111; posting-account=uo-8fwoAAACKsFzFX78JHudx1V7WDXZ0 References: <3a128081-7f5d-4641-bc5d-8cffe64f5eee@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 75.82.8.111 MIME-Version: 1.0 Subject: Re: Why does dynamic doc string do not work? From: Miki Tebeka To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org, d@davea.name, Miki Tebeka 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: , Message-ID: Lines: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345570807 news.xs4all.nl 6895 [2001:888:2000:d::a6]:40201 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27587 Thanks! > On 08/21/2012 12:44 PM, Miki Tebeka wrote: > > > > > >>> class B: > > > ... '''a {} string'''.format('doc') > > > ... > > >>>> B.__doc__ > > >>>> > > > I wonder why the first B docstring is empty. Thanks, -- Miki > > > > According to some early documentation: > > > > "convenient initialization of the |__doc__| attribute of modules, > > classes and functions by placing a string literal by itself as the first > > statement in the suite. It must be a literal -- an expression yielding a > > string object is not accepted as a documentation string, since future > > tools may need to derive documentation from source by parsing." > > > > -- > > > > DaveA