[OLPC-devel] Re: [sugar] Pygtk and garbage collecting
Robert Staudinger
robert.staudinger at gmail.com
Tue Aug 8 13:23:27 EDT 2006
On 8/8/06, Federico Mena Quintero <federico at ximian.com> wrote:
> On Tue, 2006-08-08 at 12:29 -0400, Ivan Krstic wrote:
> > Federico Mena Quintero wrote:
> > > This is pretty useful for managed objects which maintain non-managed
> > > data (file descriptors, memory buffers, database connections, etc.).
> > >
> > > Does Python let you do something like this?
> >
> > Yes, using the 'with' statement that's new in Python 2.5, which we'll
> > have on the laptop:
>
> Oooh, excellent. And it looks trivial to implement.
After a quick glance over the PEP I doubt that the resources will be
actively deallocated rather than just be out of scope and left for the
gc to pick up though. Looks like a way to explicitely free the wrapped
data is still needed if the patch mentioned by Johan is not deemed
sufficient.
- Rob
More information about the Devel
mailing list