Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #50407 > unrolled thread
| Started by | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| First post | 2013-07-11 13:57 +1000 |
| Last post | 2013-07-11 13:57 +1000 |
| 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.
Re: Documenting builtin methods Ben Finney <ben+python@benfinney.id.au> - 2013-07-11 13:57 +1000
| From | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| Date | 2013-07-11 13:57 +1000 |
| Subject | Re: Documenting builtin methods |
| Message-ID | <mailman.4560.1373515042.3114.python-list@python.org> |
Joshua Landau <joshua@landau.ws> writes: > 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. Right. It raises a SyntaxError because you've got a simple string literal that isn't closed before the end of the line. > Is there a way to get it to work simply What behaviour would you expect from that? We can't guess what you mean by “get it to work” unless we know what you're expecting and how the observed behaviour is different. A good way to do this would be to show some actual code that demonstrates the surprising behaviour (you may need to post using a service that doesn't munge your text), along with the traceback if any. Then, show a session that behaves the way you'd expect it to behave, and we can explain either how to achieve that or why it can't. -- \ Q: “I've heard that Linux causes cancer...” Torvalds: “That's a | `\ filthy lie. Besides, it was only in rats and has not been | _o__) reproduced in humans.” —Linus Torvalds | Ben Finney
Back to top | Article view | comp.lang.python
csiph-web