gc.garbage from paramiko

Jan Hudec bulb at ucw.cz
Fri Feb 10 08:55:37 GMT 2006


On Thu, Feb 09, 2006 at 23:28:48 -0800, Robey Pointer wrote:
> 
> On 9 Feb 2006, at 7:47, Neil Schemenauer wrote:
> 
> >John A Meinel <john at arbash-meinel.com> wrote:
> >>You could move the close() into the member variable. And then
> >>main_obj.close() just calls the main_obj._secret_sauce.close().
> 
> But the problem is actually closing without having close() called  
> explicitly.

Well, the __del__ method should be on the smallest object that is
actually necessary to close anything on. 

> >Even if you very careful to ensure that your code does not create a
> >cycle involving your object, the user may create one.
> >[...]
> >Using this design makes life easier for you and protects the user
> >(assuming they don't mess around with private attributes; in that
> >case they get what they deserve).
> 
> Nobody yet has explained how a user could turn my DAG into a cycle  
> without mucking around in private attributes, so I'm not convinced  
> it's possible.  (See yesterday's posts.)

I believe they can't. However you have to be careful about things like
that the object holds a reference to it's class and if you create a
bound or unbound method, it does as well.

-- 
						 Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060210/9e706020/attachment.pgp 


More information about the bazaar mailing list