file.close()

Ben Finney bignose-hates-spam at and-benfinney-does-too.id.au
Thu Jul 24 05:12:57 CEST 2003


On Wed, 23 Jul 2003 20:29:27 -0700, Erik Max Francis wrote:
> Bryan wrote:
>> is what i'm doing is overkill?
> 
> Use of external resources -- which should be released as soon as
> you're done with them -- are best done in try/finally clauses.

It seems that nesting the 'try' clauses doesn't scale well.  What if
fifty files are opened?  Must the nesting level of the 'try' clauses be
fifty also, to close them promptly?

-- 
 \      "God forbid that any book should be banned. The practice is as |
  `\               indefensible as infanticide."  -- Dame Rebecca West |
_o__)                                                                  |
http://bignose.squidly.org/ 9CFE12B0 791A4267 887F520C B7AC2E51 BD41714B




More information about the Python-list mailing list