does python have useless destructors?

Aahz aahz at pythoncraft.com
Fri Jun 11 10:55:10 EDT 2004


In article <yJmdnVsQAuSyjVTdRVn-gQ at powergate.ca>,
Peter Hansen  <peter at engcorp.com> wrote:
>Aahz wrote:
>> In article <-oadnfu_sdwTUFrdRVn-hw at powergate.ca>,
>> Peter Hansen  <peter at engcorp.com> wrote:
>>>Michael P. Soulier wrote:
>>>
>>>>myfile = open("myfilepath", "w")
>>>>myfile.write(reallybigbuffer)
>>>>myfile.close()
>>>
>>>... immediately raises a warning flag in the mind of an
>>>experienced Python programmer.
>> 
>> Depends on the circumstance, I'd think.
>
>If you mean that for simple scripts, it looks fine, then
>I agree.  Otherwise, maybe I wouldn't. ;-)

What if it's the logging routine of the app's outer exception block?
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"as long as we like the same operating system, things are cool." --piranha



More information about the Python-list mailing list