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

2017年11月23日 14:23:33 -0800

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
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to