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

Ethan Furman ethan at stoneleaf.us
Wed Nov 22 19:30:39 EST 2017

On 11/22/2017 01:40 PM, Ivan Levkivskyi wrote:
> 22 Лис 2017 22:33 "Ethan Furman" <ethan at stoneleaf.us <mailto:ethan at stoneleaf.us>> пише:

>> Right, the argument is that calling the `list` constructor should return a list -- not a database proxy, not a web
>> page, and not a generator.
> Then you didn't read my example carefully, since the whole point is that the list constructor there returns a list.

This example?

except StopIteration as e:
     assert e.value  == [42, 43, 44]


More information about the Python-Dev mailing list