Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'causing': 0.04; 'expressions': 0.07; 'dan': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'raises': 0.09; '~ethan~': 0.09; 'eagerness': 0.16; 'filename:fname piece:signature': 0.16; 'inclined': 0.16; 'subject:Different': 0.16; 'subject:expressions': 0.16; 'subject:generator': 0.16; 'thereby': 0.16; 'eager': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'subject:list': 0.30; "i'm": 0.30; 'something': 0.35; 'but': 0.35; 'really': 0.36; 'opposed': 0.36; 'charset:us-ascii': 0.36; 'should': 0.36; 'detail': 0.37; 'list': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'rather': 0.38; 'itself': 0.39; 'to:addr:python.org': 0.39; 'impact': 0.61; 'received:173': 0.61; 'simply': 0.61; 'different.': 0.84 Date: Mon, 17 Nov 2014 18:20:00 -0800 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Different behaviour in list comps and generator expressions References: <545d76fe$0$12980$c3e8da3$5496439d@news.astraweb.com> <546a8524$0$12990$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="g9MgQEb7032uxDqlbIxH9gIjlHkIU0OB3" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416277211 news.xs4all.nl 2915 [2001:888:2000:d::a6]:35205 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80992 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --g9MgQEb7032uxDqlbIxH9gIjlHkIU0OB3 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable On 11/17/2014 03:38 PM, Dan Stromberg wrote: >=20 > I'm inclined to say that list comprehensions and generator expressions > should be different. I don't really think they should be identical, > one being eager and one being lazy. Why let the implementation detail > of one impact the other? It's not the eagerness vs. laziness that's being changed, but rather what= happens in a generator when something inside the generator raises StopIteration (as opposed to the generator itself si= mply return'ing and thereby causing a StopIteration to be generated). -- ~Ethan~ --g9MgQEb7032uxDqlbIxH9gIjlHkIU0OB3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJUaqzWAAoJENZ7D1rrH75NLycP/ilrfsd+rySJIrqd0jFnwQWo ZRO6D4K3hitcE85nDOVn97EzgVClO8FRVT99reGzyBYSw100NVS1wkChsJW5R/VO 2BQk2G+Vcre6o34ntXRLgRsUB1ZU+mp0eIW2tyiMqzTGEM8oQlJeOkx5I/pC9sCs HzYyUay/ahCX+9I1qPIaQKdZGoXRPHv9SjDzBNNP2AmGFYMQ9xiYxPSZVDY2xpl0 czRPWe4sYXpJgkCCFoXzu+w3f+Dj61qJeC1n7ZgEPfe/OTCaDXAqiCaTxJo62dWB 6sluW7+7UgiIag+tD1LAphn39nb4mH1eoJv1CJcxPSdsfyt8c+5e/jcYib+1VYVa SlGChBau/vdSdSZC7weSHvzmEL9yUf8yQmpu4PGhxH8cYdDvj7+EBjzs7TsWFGK3 K2D6d8oZO8d1h3ZIII8SdGW5CfIky6LOif+uzwfLP6UFDpNjC9L55LcP/tksyLr3 33lkqstsv/8FfOtiWMGLy1COGdKY1MuekoApaHlGFi8yv1uTH3g4UrsXUjA0BrQB 3XnAHAfLiIVqGdE6dA4ARTvBo6geAVCGcCU0bw+U21dX0RsBMbG6VJ1PGJibICjw n/J8KF68Hgv5mtsU2KE+h6uqjEgpp1siFiQhGfWkoQ/VXUbS8HKvYoNTUCSN0FR+ kxSr3/zCorfV3q/8Eq0G =nWgD -----END PGP SIGNATURE----- --g9MgQEb7032uxDqlbIxH9gIjlHkIU0OB3--