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


Groups > comp.lang.python > #101907

Re: Why generators take long time?

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Jason Swails <jason.swails@gmail.com>
Newsgroups comp.lang.python
Subject Re: Why generators take long time?
Date Tue, 19 Jan 2016 15:25:44 -0500
Lines 21
Message-ID <mailman.112.1453235154.15297.python-list@python.org> (permalink)
References <1e092318-5052-4383-aabe-dd979d72645d@googlegroups.com> <CAEk9e3oy+Nx7JPKiHqujOWvNGmM8Jdw2SBv3PHAt6iS=zWqXjg@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-Trace news.uni-berlin.de 4AVNHEjuxHormZQ1Bnt0NAapUKOPR5Xwygu9+wwQyVcw==
Return-Path <jason.swails@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'expressions': 0.07; 'received:209.85.213.46': 0.07; 'cc:addr:python-list': 0.09; 'subject:Why': 0.09; 'jan': 0.11; '2016': 0.16; 'cc:name:python list': 0.16; 'decent': 0.16; 'iteration': 0.16; 'iterator': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'email addr:gmail.com&gt;': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'forgot': 0.23; 'header:In-Reply- To:1': 0.24; '(which': 0.26; 'message-id:@mail.gmail.com': 0.27; 'tue,': 0.34; 'received:google.com': 0.35; 'jason': 0.35; 'subject:time': 0.35; 'received:209.85': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'thought': 0.37; 'received:209': 0.38; 'where': 0.40; 'some': 0.40; 'chance': 0.60; 'here.': 0.62; 'subject:long': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=+1b5fHTvNRC3Ko0jf59i5qrQKOY2B/kxQgq87DWvNGI=; b=b7Eo2R5eXy6sK5fbdxFNNMyh83fzProzdbSZH1RGKJPmzf6airq2hShVyHDZntWyJZ 3SYnPDYpUDIPeXATIrK1enmq9uo8Lk4bUXIF80dR0Zrsoq5RIqr3YQPACw7qlpSlhGOZ +hgG6WC3CYIsco8hwPjB99nH8F4ZwJ73nzunkncmqbZyxSxZhJnjEeyLc7MurOlRugoZ fmPEDXC94kTwTu9FC3TniZhkYzSRvSAoenTNVrMlvWZ/P87R/Ug9LIcT3F0e45LTEQwu FCLfEMoqB1tSSgBVnzPhvTMcdlWbSmnmorYgaroPFDP+PSbqQSOsGpkRUBlfr1gVtRnS 9nqg==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=+1b5fHTvNRC3Ko0jf59i5qrQKOY2B/kxQgq87DWvNGI=; b=XYY04vhQEUqYJoDZhl371ISo5w+UCcMvuLt8C5kiYmZnJnGA2edT921D7ydkLVx3bu xnndxNXtHr8ea3CnFNUDpmglyJeIXuhg/rNrDSwzexwFk1GxmaYX+Ml/LY22XAwD3H3U Bnizp+wRGawC/cswEZ1prjg0ThxMGGJD/9rpcbTLzSEX1tdjA7ByEo2QgLqdy4BQvyaX 7UgbQXbKnGmt+e3lgGP8aKLgqgMwYPpV+k/8cWeC/pD6mIZtke0AxYAhBqXt4pyfbreh xhTISiDfXj8YYCA/RTVbaLTk+Smz7SPKDcMqECAIXESpTenHVo4doFjs+HINWsstT/06 8EMA==
X-Gm-Message-State ALoCoQnotPNPv4tpnEDh9xwhiS9My38lsNY1MD/YZDNsgIz148SQ9g+5/2m64pbtglrN2t3XjVaXvZnQQkFNmeDr23xBsC17UA==
X-Received by 10.31.155.23 with SMTP id d23mr19284244vke.146.1453235144654; Tue, 19 Jan 2016 12:25:44 -0800 (PST)
In-Reply-To <CAEk9e3oy+Nx7JPKiHqujOWvNGmM8Jdw2SBv3PHAt6iS=zWqXjg@mail.gmail.com>
X-Content-Filtered-By Mailman/MimeDel 2.1.20+
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:101907

Show key headers only | View raw


On Tue, Jan 19, 2016 at 3:19 PM, Jason Swails <jason.swails@gmail.com>
wrote:

>
> I use generator expressions when
>
> - I *might* want to
>

​I forgot to finish my thought here.  I use generator expressions when I
don't want to worry about memory, there's a decent chance of
short-circuiting​, or I just want to do some simple iteration where the
iterator will not be the bottleneck (which is almost always).

-- 
Jason M. Swails
BioMaPS,
Rutgers University
Postdoctoral Researcher

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


Thread

Why generators take long time? Arshpreet Singh <arsh840@gmail.com> - 2016-01-18 23:27 -0800
  Re: Why generators take long time? Arshpreet Singh <arsh840@gmail.com> - 2016-01-19 00:06 -0800
  Re: Why generators take long time? Steven D'Aprano <steve@pearwood.info> - 2016-01-19 21:11 +1100
    Re: Why generators take long time? Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2016-01-19 10:24 +0000
      Re: Why generators take long time? Steven D'Aprano <steve@pearwood.info> - 2016-01-20 10:58 +1100
    Re: Why generators take long time? Arshpreet Singh <arsh840@gmail.com> - 2016-01-19 11:35 -0800
  Re: Why generators take long time? Jason Swails <jason.swails@gmail.com> - 2016-01-19 15:19 -0500
  Re: Why generators take long time? Jason Swails <jason.swails@gmail.com> - 2016-01-19 15:25 -0500

csiph-web