A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2007-July/073790.html below:

[Python-Dev] itertools addition: getitem()

[Python-Dev] itertools addition: getitem() [Python-Dev] itertools addition: getitem()Steven Bethard steven.bethard at gmail.com
Sun Jul 8 17:56:04 CEST 2007
On 7/8/07, Kevin Jacobs <jacobs at bioinformed.com> <bioinformed at gmail.com> wrote:
> Also vaguely apropos:
>
> def ilen(seq):
>   'Return the length of the hopefully finite sequence'
>   n = 0
>   for x in seq:
>      n += 1
>   return n

Also known as::

    sum(1 for _ in iterable)

That's always been simple enough that I didn't feel a need for an
ilen() function.

STeVe
-- 
I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
        --- Bucky Katt, Get Fuzzy
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4