Re: "flushing"/demanding generator contents - implications for injection of control

2007-02-06 Thread metaperl
On Feb 5, 3:08 pm, Jussi Salmela <[EMAIL PROTECTED]> wrote: > metaperl kirjoitti: > > > For this program: > > > def reverse(data): > > for index in range(len(data)-1, -1, -1): > > yield data[index] > > > r = reverse("golf") > > > for char in r: > > print char > > > I'm wondering if

Re: "flushing"/demanding generator contents - implications for injection of control

2007-02-05 Thread Gabriel Genellina
En Mon, 05 Feb 2007 16:47:43 -0300, metaperl <[EMAIL PROTECTED]> escribió: > For this program: > > def reverse(data): > for index in range(len(data)-1, -1, -1): > yield data[index] > > r = reverse("golf") > > for char in r: > print char > > > I'm wondering if the line: > > r = rev

Re: "flushing"/demanding generator contents - implications for injection of control

2007-02-05 Thread Jussi Salmela
metaperl kirjoitti: > For this program: > > def reverse(data): > for index in range(len(data)-1, -1, -1): > yield data[index] > > r = reverse("golf") > > for char in r: > print char > > > I'm wondering if the line: > > r = reverse("golf") > > "demands" the contents of the fun

"flushing"/demanding generator contents - implications for injection of control

2007-02-05 Thread metaperl
For this program: def reverse(data): for index in range(len(data)-1, -1, -1): yield data[index] r = reverse("golf") for char in r: print char I'm wondering if the line: r = reverse("golf") "demands" the contents of the function reverse() all at once and if I must write for c