Re: [Python-Dev] iter alternate form and *args and **kwargs

2005-06-16 Thread Steven Bethard
Steven Bethard wrote: > I would prefer that the alternate iter() form was broken off into > another separate function, say, iterfunc(), that would let me write > Jp's solution something like: > > for chunk in iterfunc('', f1.read, CHUNK_SIZE): > f2.write(chunk) Benji York wrote: > for chunk in

Re: [Python-Dev] iter alternate form and *args and **kwargs (Was: Wishlist: dowhile)

2005-06-16 Thread James Y Knight
On Jun 16, 2005, at 10:50 AM, Steven Bethard wrote: > On 6/15/05, Benji York <[EMAIL PROTECTED]> wrote: > >> Steven Bethard wrote: >> >>> I would prefer that the alternate iter() form was broken off into >>> another separate function, say, iterfunc(), that would let me write >>> Jp's solution som

Re: [Python-Dev] iter alternate form and *args and **kwargs

2005-06-16 Thread Michael Hudson
Steven Bethard <[EMAIL PROTECTED]> writes: > On 6/15/05, Benji York <[EMAIL PROTECTED]> wrote: >> Steven Bethard wrote: >> > I would prefer that the alternate iter() form was broken off into >> > another separate function, say, iterfunc(), that would let me write >> > Jp's solution something like:

Re: [Python-Dev] iter alternate form and *args and **kwargs (Was: Wishlist: dowhile)

2005-06-16 Thread Steven Bethard
On 6/15/05, Benji York <[EMAIL PROTECTED]> wrote: > Steven Bethard wrote: > > I would prefer that the alternate iter() form was broken off into > > another separate function, say, iterfunc(), that would let me write > > Jp's solution something like: > > > > for chunk in iterfunc('', f1.read, CHUNK_

Re: [Python-Dev] iter alternate form and *args and **kwargs (Was: Wishlist: dowhile)

2005-06-15 Thread Benji York
Steven Bethard wrote: > It reminds me of one of my minor gripes about the standard lib -- a > number of functions that take another function as an argument don't > take *args and **kwargs to be passed to that function when it's > called. The iter() alternate form is a common example of this. I > wo

[Python-Dev] iter alternate form and *args and **kwargs (Was: Wishlist: dowhile)

2005-06-15 Thread Steven Bethard
Jp Calderone: > for chunk in iter(lambda: f1.read(CHUNK_SIZE), ''): > f2.write(chunk) Phillip J. Eby: > More seriously, I think your translation makes an excellent argument in > *favor* of having a do/while statement for greater clarity. :) Michael Chermside > Interesting... I had the oppo