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


Groups > comp.lang.python > #50406 > unrolled thread

Re: Documenting builtin methods

Started byMark Janssen <dreamingforward@gmail.com>
First post2013-07-10 20:29 -0700
Last post2013-07-10 20:29 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Documenting builtin methods Mark Janssen <dreamingforward@gmail.com> - 2013-07-10 20:29 -0700

#50406 — Re: Documenting builtin methods

FromMark Janssen <dreamingforward@gmail.com>
Date2013-07-10 20:29 -0700
SubjectRe: Documenting builtin methods
Message-ID<mailman.4559.1373513356.3114.python-list@python.org>
> 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?

I think the canonical way to specialize a class (even if it's only
docstrings or method re-names) is to extend it with a new class.

markj

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web