[Python-Dev] PEP 343 - Abstract Block Redux

Shane Hathaway shane at hathawaymix.org
Tue May 17 05:04:35 CEST 2005


Guido van Rossum wrote:
> [Ron Adam]
> 
>>with opening(file1,m),opening(file2,m),opening(file3,m) as f1,f2,f3:
>>     # do stuff with files
>>
> 
> I'm -0 on this, if only because it complicates things a fair bit for a
> very minor improvement in functionality. [...]
> It's always something we can add in the future, since it's guaranteed
> that this syntax (or a tuple value) is invalid in the curernt
> proposal. So I'd rather punt on this.

Also, you can already get 90% of this with the combining() wrapper I
posted earlier.

    with combining(opening(file1,m),opening(file2,m),opening(file3,m)
        ) as f1,f2,f3:
        # do stuff with files

Shane


More information about the Python-Dev mailing list