Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #82291 > unrolled thread
| Started by | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| First post | 2014-12-10 09:07 -0700 |
| Last post | 2014-12-10 09:07 -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.
Re: Nested loops is strangely slow, totally at a loss. Ian Kelly <ian.g.kelly@gmail.com> - 2014-12-10 09:07 -0700
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Date | 2014-12-10 09:07 -0700 |
| Subject | Re: Nested loops is strangely slow, totally at a loss. |
| Message-ID | <mailman.16812.1418227676.18130.python-list@python.org> |
[Multipart message — attachments visible in raw view] — view raw
On Wed, Dec 10, 2014 at 9:01 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote: > This also seems perfectly natural: > > def len(iterable): > return sum(1 for item in iterable) > > My observation is that seems strange to me that one standard sequence operation should be supported for arbitrary iterators and the other not. > > If the objection about `len(count())` is that the call would never return, I'll point out that `-42 in count()` suffers the same problem. To further clarify what I'm saying, I don't think that len(iterable) should be supported. I'm just dismayed that "x in iterable" already is.
Back to top | Article view | comp.lang.python
csiph-web