9 Oct
2012
9 Oct
'12
4:14 p.m.
Serhiy Storchaka wrote:
Is a generator expression work with the iterator protocol or the generator protocol?
Iterator protocol, I think. There is no way to explicitly return a value from a generator expression, and I don't think it should implicitly return one either. Keep in mind that there can be more than one iterable involved in a genexp, so it's not clear what the return value should be in general. -- Greg