Re: Python's "only one way to do it" philosophy isn't good?
- From: Douglas Alan <doug@xxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 14:06:09 -0400
Michele Simionato <michele.simionato@xxxxxxxxx> writes:
Right. So? I understand this issue completely and I code
accordingly.
What does it mean you 'code accordingly'? IMO the only clean way out
of this issue is to NOT rely on the garbage collector and to manage
resource deallocation explicitely, not implicitely.
(1) I don't rely on the refcounter for resources that ABSOLUTELY,
POSITIVELY must be freed before the scope is left. In the code that
I've worked on, only a small fraction of resources would fall into
this category. Open files, for instance, rarely do. For open files,
in fact, I actually want access to them in the traceback for debugging
purposes, so closing them using "with" would be the opposite of what I
want.
(2) I don't squirrel away references to tracebacks.
(3) If a procedure catches an exception but isn't going to return
quickly, I clear the exception.
|>oug
.
- References:
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Antoon Pardon
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Douglas Alan
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Alexander Schmolck
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Douglas Alan
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Paul Rubin
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Douglas Alan
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Paul Rubin
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Douglas Alan
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Chris Mellon
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Douglas Alan
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Chris Mellon
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Douglas Alan
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Michele Simionato
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Douglas Alan
- Re: Python's "only one way to do it" philosophy isn't good?
- From: Michele Simionato
- Re: Python's "only one way to do it" philosophy isn't good?
- Prev by Date: Re: Python's "only one way to do it" philosophy isn't good?
- Next by Date: Re: Python's "only one way to do it" philosophy isn't good?
- Previous by thread: Re: Python's "only one way to do it" philosophy isn't good?
- Next by thread: Re: Python's "only one way to do it" philosophy isn't good?
- Index(es):
Relevant Pages
|