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


Groups > comp.lang.python > #27586

Re: Why does dynamic doc string do not work?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!eweka.nl!hq-usenetpeers.eweka.nl!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'attribute': 0.05; 'literal': 0.09; 'subject:Why': 0.09; 'subject:string': 0.09; 'cc:addr:python-list': 0.10; 'subject:not': 0.11; 'docstring': 0.16; 'empty.': 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; 'cc:2**0': 0.23; 'statement': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'wonder': 0.27; '>>>>': 0.29; 'source': 0.29; 'class': 0.29; 'classes': 0.30; 'pm,': 0.35; 'subject:?': 0.35; 'itself': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'some': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; 'first': 0.61; 'header:Reply- To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'received:74.208.4.194': 0.84
Date Tue, 21 Aug 2012 13:30:39 -0400
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0
MIME-Version 1.0
To Miki Tebeka <miki.tebeka@gmail.com>
Subject Re: Why does dynamic doc string do not work?
References <3a128081-7f5d-4641-bc5d-8cffe64f5eee@googlegroups.com>
In-Reply-To <3a128081-7f5d-4641-bc5d-8cffe64f5eee@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:xp4tDD2O2Ob20RMMvO5ZExFazhB3rdCMjC6hqnQ2lP2 9BV6+veP0SZ6ZtF4o+f8RGyUyPPeq+NVARGQTI0pIErj2Lc8jB CTefw+ptfseNlreRalwpjt3B8gq0+Tf7m52DYcF+Bf8fW/h812 I/TdLoaURLT32Codv9dSgtPFHNfgyWIZ9gK7VGMjty9znXcMfh p/Rr1mGs1ncE6RTAK0BlAAWY3SroXvWhAQijmckeXqBhfXLhl3 w/t6pfYyTxdhJwFZzqb2kucytbLKkgorqvzN069TMBIx+ZTkrh Is3ssn4oesbIdsuQvbd1ea/bLWXZMgKT8612hMx8cxvI6FIAQ= =
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To d@davea.name
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.3613.1345570273.4697.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1345570273 news.xs4all.nl 6922 [2001:888:2000:d::a6]:33200
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:27586

Show key headers only | View raw


On 08/21/2012 12:44 PM, Miki Tebeka wrote:
> <snip>
>>> class B:
> ...     '''a {} string'''.format('doc')
> ... 
>>>> B.__doc__
>>>>
> <snip>      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

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


Thread

Why does dynamic doc string do not work? Miki Tebeka <miki.tebeka@gmail.com> - 2012-08-21 09:44 -0700
  Re: Why does dynamic doc string do not work? Ian Kelly <ian.g.kelly@gmail.com> - 2012-08-21 11:09 -0600
  Re: Why does dynamic doc string do not work? MRAB <python@mrabarnett.plus.com> - 2012-08-21 18:16 +0100
  Re: Why does dynamic doc string do not work? Ian Kelly <ian.g.kelly@gmail.com> - 2012-08-21 11:21 -0600
  Re: Why does dynamic doc string do not work? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-08-21 17:22 +0000
  Re: Why does dynamic doc string do not work? Dave Angel <d@davea.name> - 2012-08-21 13:30 -0400
    Re: Why does dynamic doc string do not work? Miki Tebeka <miki.tebeka@gmail.com> - 2012-08-21 10:40 -0700
    Re: Why does dynamic doc string do not work? Miki Tebeka <miki.tebeka@gmail.com> - 2012-08-21 10:40 -0700

csiph-web