On Jun 29, 7:52 am, "Guido van Rossum" <[EMAIL PROTECTED]> wrote: > On Sat, Jun 28, 2008 at 5:39 PM, Greg Ewing <[EMAIL PROTECTED]> wrote: > > Nick Coghlan wrote: > > >> It's a fact of Python development: __del__ methods cannot safely reference > >> module globals, because those globals may be gone by the time that method > >> is > >> invoked. > > > Speaking of this, has there been any more thought given > > to the idea of dropping the module clearing and just > > relying on cyclic GC? > > No, but it is an intriguing thought nevertheless. The module clearing > causes nothing but trouble... This is exactly what my post tried to address. I assumed it was clear that module clearing is the wrong solution, and that it was also clear that due to the cycles I mentioned (global.__class__.__dict__['any_method'].func_globals['global'] is global), all globals that have a __del__ will not be collectible. Therefore, I proposed a solution to cycles with a __del__ in them. Only with this solution it is possible to replace module clearing with normal garbage collection.
Eyal > > -- > --Guido van Rossum (home page:http://www.python.org/~guido/) > _______________________________________________ > Python-Dev mailing list > [EMAIL PROTECTED]://mail.python.org/mailman/listinfo/python-dev > Unsubscribe:http://mail.python.org/mailman/options/python-dev/python-dev2-garchiv... _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com