Anonymous file closing

Peter Hansen peter at engcorp.com
Fri Jun 11 15:29:07 EDT 2004


Sergey Krushinsky wrote:

> Peter Hansen wrote:
> 
>> Duncan's response says it all, but here's the solution
>> if you don't like the uncertainty inherent in the above:
>>
>> f = open(filename, 'r')
>> try:
>>     text = f.read()
>> finally:
>>     f.close()
>>
> But the uncertainty remains in case of an anonymous file, doesn't it?

What's an "anonymous file"?  The term means nothing to me...



More information about the Python-list mailing list