Chris Angelico <ros...@gmail.com>:

> On Sun, Mar 15, 2015 at 11:15 AM, Marko Rauhamaa <ma...@pacujo.net> wrote:
>> What features do generator iterators provide on top of generic
>> iterators?
>
> You can send values into them, throw exceptions into them, and close
> them (which is a special case of the latter).

Hm. I wonder why the distinction was made. IOW, why is

   iter([1, 2, 3])

not equivalent with

   (x for x in [1, 2, 3])

I can close the latter but not the former.

After all,

   yield from [1, 2, 3]

works all right.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to