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


Groups > comp.lang.python > #9196

Re: Function docstring as a local variable

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <kb1pkl@aim.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'content- type:multipart/signed': 0.09; 'filename:fname piece:signature': 0.09; 'header:In-reply-to:1': 0.09; 'subject:Function': 0.09; "'and": 0.16; '(besides': 0.16; 'abraham': 0.16; 'content- type:application/pgp-signature': 0.16; 'docstring': 0.16; 'filename:fname piece:asc': 0.16; 'filename:fname:signature.asc': 0.16; 'from:addr:kb1pkl': 0.16; 'from:name:corey richardson': 0.16; 'richardson': 0.16; 'subject:variable': 0.16; 'def': 0.16; 'to:name:python-list': 0.19; 'is?': 0.22; "doesn't": 0.22; 'though.': 0.23; 'string': 0.26; 'pass': 0.28; 'object': 0.30; '-0400': 0.30; 'print': 0.32; 'it.': 0.33; 'actually': 0.33; 'to:addr:python-list': 0.34; 'header:User-Agent:1': 0.34; 'points': 0.34; 'try:': 0.35; 'skip:" 10': 0.36; 'received:76': 0.38; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'matter': 0.61; 'header:Message-Id:1': 0.61; 'received:172.29': 0.64; 'received:r1000.mx.aol.com': 0.64; 'from:addr:aim.com': 0.67; 'freedom': 0.68; '2011:': 0.84; 'subject:local': 0.84
Subject Re: Function docstring as a local variable
From Corey Richardson <kb1pkl@aim.com>
To python-list <python-list@python.org>
In-reply-to <ivd920$90e$1@dough.gmane.org>
References <mailman.842.1310319682.1164.python-list@python.org> <64b5198e-5cc7-4790-898e-7f1abb199230@y24g2000yqb.googlegroups.com> <ivd920$90e$1@dough.gmane.org>
Date Sun, 10 Jul 2011 19:00:11 -0400
User-Agent Sup/0.12.1
Content-Transfer-Encoding 8bit
MIME-Version 1.0
Content-Type multipart/signed; micalg="pgp-sha256"; boundary="=-1310338815-323344-8792-8161-1-="; protocol="application/pgp-signature"
x-aol-global-disposition G
X-AOL-VSS-INFO 5400.1158/72244
X-AOL-VSS-CODE scan_error
X-AOL-SCOLL-SCORE 0:2:416171008:93952408
X-AOL-SCOLL-URL_COUNT 0
x-aol-sid 3039ac1d33824e1a2f1c64f1
X-AOL-IP 76.119.157.207
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.858.1310339158.1164.python-list@python.org> (permalink)
Lines 55
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1310339158 news.xs4all.nl 21843 [2001:888:2000:d::a6]:53470
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:9196

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Excerpts from Colin J. Williams's message of Sun Jul 10 18:28:15 -0400 2011:
> Try:
> 
> def f():
>       ds= """docstring"""
>       print ds

That doesn't actually make a docstring, though. It makes a string object and
points the name ds at it. Do you know what a docstring is?

def foo():
    """I am a docstring"""
    pass

def bar():
    ds = "I am not a docstring!"

def baz():
    "I am a docstring too!"
    pass

def qux():
    'And even me! Quote type don't matter (besides style)'
     pass
-- 
Corey Richardson
  "Those who deny freedom to others, deserve it not for themselves"
     -- Abraham Lincoln

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


Thread

Function docstring as a local variable Tim Johnson <tim@johnsons-web.com> - 2011-07-10 09:41 -0800
  Re: Function docstring as a local variable rantingrick <rantingrick@gmail.com> - 2011-07-10 10:44 -0700
    Re: Function docstring as a local variable "Colin J. Williams" <cjw@ncf.ca> - 2011-07-10 18:28 -0400
      Re: Function docstring as a local variable Ben Finney <ben+python@benfinney.id.au> - 2011-07-11 09:48 +1000
    Re: Function docstring as a local variable Corey Richardson <kb1pkl@aim.com> - 2011-07-10 19:00 -0400
      Re: Function docstring as a local variable Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-07-11 11:54 +1000
      Re: Function docstring as a local variable alex23 <wuwei23@gmail.com> - 2011-07-10 21:05 -0700

csiph-web