23 Oct
2012
23 Oct
'12
5:07 a.m.
On Mon, Oct 22, 2012 at 9:55 AM, Steve Dower <Steve.Dower@microsoft.com> wrote:
I think the abstract for PEP 380 sums is up pretty well: "A syntax is proposed for a generator to delegate part of its operations to another generator." Using 'yield from' (YF, for convenience) requires (a) that the caller is a generator and (b) that the callee is a generator.
Rather, the callee must be some iterable: def f(): yield from [1, 2, 3] for x in f(): print(x) -eric