Why no open(f, "w").write()?

Kragen Sitaker kragen at pobox.com
Wed May 29 21:55:46 EDT 2002


"Delaney, Timothy" <tdelaney at avaya.com> writes:
> You should never rely on automatic freeing of *any* resources unless it is
> guaranteed. Always explicitly free resources when you have finished with
> them.

You mean, assume you have no garbage collector?  If I had to do that,
my Python code would get a *lot* more complex.

I do believe that relying on timely finalization is a mistake, because
every efficient garbage collector fails to perform timely
finalization.  I hope that someday in the future, CPython can have an
efficient garbage collector too.




More information about the Python-list mailing list