On 15 Jan 2006 18:58:53 -0800, Paul Rubin <http://[EMAIL PROTECTED]> wrote:

>Jean-Paul Calderone <[EMAIL PROTECTED]> writes:
>> Which is only very slightly longer than your version.  I would like
>> it even more if iter() had been written with the impending doom of
>> lambda in mind, so that this would work:
>> 
>>     for chunk in iter('', f.read, blocksize):
>>         ...
>> 
>> But it's a bit late now.
>
>Well, iter could be extended to take *args and **kwargs parameters, so
>you'd say
>
>    for chunk in iter(f.read, '', (blocksize,)): ...
>
Whatever "Which" refers to got snipped or may be in a post that hasn't
become visible for me yet, but I assume Jean-Paul was referring to lambda use
as in e.g. (untested):

     for chunk in iter(lambda frd=open('yerf', 'rb').read:frd(blocksize), ''): 
...

Does it not do what you want?

Regards,
Bengt Richter
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to