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


Groups > comp.lang.python > #50405

Documenting builtin methods

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <joshua.landau.ws@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.118
X-Spam-Level *
X-Spam-Evidence '*H*': 0.77; '*S*': 0.00; 'caching': 0.16; 'collections': 0.16; 'deque': 0.16; 'iterator': 0.16; 'sender:addr:gmail.com': 0.17; 'obviously': 0.18; 'import': 0.22; 'creating': 0.23; 'code:': 0.26; 'message-id:@mail.gmail.com': 0.30; 'work.': 0.31; '(which': 0.31; 'to:name:python-list': 0.33; 'skip:d 20': 0.34; 'received:google.com': 0.35; 'there': 0.35; 'to:addr:python-list': 0.38; 'rather': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'new': 0.61; 'simply': 0.61; 'simple': 0.61; 'yielded': 0.84; 'inefficient': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=gN9KTE7336friZXj9NJcVuNTYfMXrcHHULJjlTXzyCE=; b=MDvMRonG4bqx0f2BKjn82lNft0lkVeG9F1zil8ex3stS8lBfhtcwGxZ00SsV+UHb5+ IvS3JEWkR7LjDlwEnDOeC7TfjXVscNJyJlK9kiSM6Te/llGYBKW8CQsTfS2+ZyVGziCU OAcpZfegWf83d96NIM9LoY/pn3oVVOsCBl5l8eGoW1/PdLQZFLjGEa3kX+6x55JhJU2l e1c1Xmz5uGiyRjdGeBRNG4krokrh0VJAwib2sR+QtexWersegzgiGm1z3BNXZ7l/yTyQ B2LeJ6SzSbThc2TWlfZudFClBMZIoIIh9lBWwnJWOWdN6ExE1dUREKBknj5tAammXrE1 5D1w==
X-Received by 10.112.182.39 with SMTP id eb7mr16153418lbc.30.1373512577912; Wed, 10 Jul 2013 20:16:17 -0700 (PDT)
MIME-Version 1.0
Sender joshua.landau.ws@gmail.com
From Joshua Landau <joshua@landau.ws>
Date Thu, 11 Jul 2013 04:15:37 +0100
X-Google-Sender-Auth y7vccBc93Wz4QaSDTMOd6lAcAP4
Subject Documenting builtin methods
To python-list <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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.4558.1373512579.3114.python-list@python.org> (permalink)
Lines 12
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1373512579 news.xs4all.nl 15867 [2001:888:2000:d::a6]:42321
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:50405

Show key headers only | View raw


I have this innocent and simple code:

from collections import deque
exhaust_iter = deque(maxlen=0).extend
exhaust_iter.__doc__ = "Exhaust an iterator efficiently without
caching any of its yielded values."

Obviously it does not work. Is there a way to get it to work simply
and without creating a new scope (which would be a rather inefficient
a way to set documentation, and would hamper introspection)?

How about dropping the "simply" requirement?

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


Thread

Documenting builtin methods Joshua Landau <joshua@landau.ws> - 2013-07-11 04:15 +0100
  Re: Documenting builtin methods alex23 <wuwei23@gmail.com> - 2013-07-11 15:35 +1000
  Re: Documenting builtin methods Steven D'Aprano <steve@pearwood.info> - 2013-07-11 06:06 +0000
    Re: Documenting builtin methods Chris Angelico <rosuav@gmail.com> - 2013-07-11 17:06 +1000
      Re: Documenting builtin methods Steven D'Aprano <steve@pearwood.info> - 2013-07-11 07:15 +0000
        Re: Documenting builtin methods Chris Angelico <rosuav@gmail.com> - 2013-07-11 17:23 +1000
    Re: Documenting builtin methods Joshua Landau <joshua@landau.ws> - 2013-07-12 00:11 +0100
      Re: Documenting builtin methods alex23 <wuwei23@gmail.com> - 2013-07-12 13:43 +1000
        Re: Documenting builtin methods Joshua Landau <joshua@landau.ws> - 2013-07-12 08:09 +0100

csiph-web