[DB-SIG] Standardized "with" block behavior?

Ricardo Bugalho ricardo.b at zmail.pt
Mon Sep 25 21:38:54 CEST 2006


On Mon, 2006-09-25 at 12:28 +0200, M.-A. Lemburg wrote:
> Mario Frasca wrote:
> > On 2006-0925 10:27:16, M.-A. Lemburg wrote:
> >> Sounds reasonable, though strictly speaking, the with-container
> >> is not necessary, since cursors and connections will close themselves
> >> when garbage collected, ie. as soon as they go out of scope.
> > 
> > this (garbage collected as soon as they go out of scope) is more
> > implementation dependent than absolutely true...
> > 
> > the garbage collector is activated "when it feels like", and will
> > collect all garbage, or maybe just as much garbage as it is given time
> > to..., again depending on the implementation and the situation.
> 
> This is only true for Jython and perhaps IronPython (I don't know
> how objects are managed there).
> 
> In CPython, an object is GCed as soon as the reference count
> falls to zero.

That could change the day someone decides to write a CPython with better
multi-threaded performanc







More information about the DB-SIG mailing list