On Sun, 11 Aug 2013 14:16:10 +0200 Stefan Behnel <stefan...@behnel.de> wrote: > > > We > > just need to devise a convenience API for that (perhaps by allowing to > > create both the subclass *and* instantiate it in a single call). > > Right. This conflicts somewhat with the simplified module creation. If the > module loader passed the readily instantiated module instance into the > module init function, then module subtypes don't fit into this scheme anymore. > > One more reason why modules shouldn't be special. Essentially, we need an > m_new() and m_init() for them. And the lifetime of the module type would > have to be linked to the (sub-)interpreter, whereas the lifetime of the > module instance would be determined by whoever uses the module and/or > decides to unload/reload it.
It may be simpler if the only strong reference to the module type is in the module instance itself. Successive module initializations would get different types, but that shouldn't be a problem in practice. Regards Antoine. _______________________________________________ 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