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/2017-November/150794.html below:

[Python-Dev] Tricky way of of creating a generator via a comprehension expression

[Python-Dev] Tricky way of of creating a generator via a comprehension expression [Python-Dev] Tricky way of of creating a generator via a comprehension expressionGreg Ewing greg.ewing at canterbury.ac.nz
Thu Nov 23 17:20:31 EST 2017
Serhiy Storchaka wrote:
> Ivan explained that 
> this function should be rough equivalent to
> 
>    def f():
>        t = [(yield i) for i in range(3)]
>        return (x for x in t)

This seems useless to me. It turns a lazy iterator
into an eager one, which is a gross violation of the
author's intent in using a generator expression.

-- 
Greg
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