[Python-Dev] PEP 442 aftermath: module globals at shutdown (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Tue Jul 30 23:32:23 CEST 2013


On Tue, 30 Jul 2013 12:58:58 -0700 Guido van Rossum <guido at python.org> wrote:

I'm very excited to see this happening! It's been a constant pain and one of the things I've always regretted. Thanks Antoine!

Note this is currently imperfect. I've identified two reasons why a pure Python module could stay alive even after being removed from sys.modules:

Regards

Antoine.

--Guido On Tue, Jul 30, 2013 at 11:42 AM, Antoine Pitrou <solipsis at pitrou.net> wrote: > > Hello, > > PEP 442 has now been committed in time for testing in Alpha 1. > > This paves the way for the removal of another well-known annoyance: the > behaviour of module globals at shutdown. Now that reference cycles > aren't a barrier to object finalization anymore, we shouldn't need > to set module globals to None before trying to reclaim modules. > (and then, we don't need to cache global functions for use in > finalizers, either) > > I have a patch to suppress the hack in > http://bugs.python.org/issue18214 > Once I get to add some tests, I would like to commit it soon too! > > Regards > > Antoine.



More information about the Python-Dev mailing list