Re:A Programming Idiom You've Never Heard Of
by masklinn on Wednesday January 04, 2012 @03:20PM
(#3425721)
> For that to work as it does in CPython, the file would have to know it has no name reference attached to it and that its scope is limited to the iteration and that it can close the file when the iteration ends.
Which will never happen and really has nothing to do with iteration (or the file object itself)
> I'd love to have this idiom supported under other implementations - it's beautiful.
I disagree on its beauty, but beyond that I can assure you it's never going to be a property of python-the-language.
Which will never happen and really has nothing to do with iteration (or the file object itself)
> I'd love to have this idiom supported under other implementations - it's beautiful.
I disagree on its beauty, but beyond that I can assure you it's never going to be a property of python-the-language.