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/2003-October/039288.html below:

[Python-Dev] accumulator display syntax

[Python-Dev] accumulator display syntax [Python-Dev] accumulator display syntaxNeil Schemenauer nas-python at python.ca
Wed Oct 22 11:08:16 EDT 2003
On Wed, Oct 22, 2003 at 01:19:58AM -0400, Raymond Hettinger wrote:
>     Experience with list expressions has shown their wide-spread
>     utility throughout Python.  However, many of the use cases do
>     not need to have a full list created in memory.  Instead, they
>     only need to iterate over the elements one at a time.

I see generator expression as making available the iterator guts of
list comprehensions available as a first class object.  The list()
call is not always wanted.

>     1) In order to achieve a performance gain, generator expressions need
>     to be run in the local stackframe
[...]
>     Accordingly, the generator expression cannot be returned
>     to another function:

That would be unacceptable, IMHO.  Generator expressions should be
first class.  Luckily, generator functions are speedy little buggers. :-)

  Neil

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