[issue6401] Unexpected module garbage collection

2009-07-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: This is a quirk of module finalization semantics. You've got to consider the following facts: - a class doesn't hold a reference to the module it is defined it, because it doesn't need to (the __module__ attribute is a string) - a function (and a method) holds a

[issue6401] Unexpected module garbage collection

2009-07-02 Thread Benjamin Peterson
Benjamin Peterson added the comment: The class doesn't hold any references to the module, so naturally it will be collected if you don't. -- nosy: +benjamin.peterson resolution: -> invalid status: open -> closed ___ Python tracker

[issue6401] Unexpected module garbage collection

2009-07-02 Thread j_pok
New submission from j_pok : This code does not behave as I expected. Removing module from sys.modules and from local variable causes garbage collection (?) of module in spite of there is an instance of a class from this module. Instance method test() from TestClass returns global variable cont