A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-January/085255.html below:

Add a "while" clause to generator expressions

[Python-Dev] PEP 3142: Add a "while" clause to generator expressions [Python-Dev] PEP 3142: Add a "while" clause to generator expressionsNick Coghlan ncoghlan at gmail.com
Tue Jan 20 21:42:36 CET 2009
Gerald Britton wrote:
> I wonder if this is a bug?

Nope, it's part of the defined behaviour. Avoiding the overhead of the
GE machinery is actually the main advantage in using a comprehension
over the equivalent generator expression. Deliberately raising
StopIteration is about the only way to notice the small semantics
difference (in Py3k anyway - in 2.x there are scoping differences as well).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
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