[Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to (original) (raw)

Brett Cannon brett at python.org
Wed May 29 15:04:01 CEST 2013


On May 29, 2013 1:09 AM, "Nick Coghlan" <ncoghlan at gmail.com> wrote:

On Wed, May 29, 2013 at 10:14 AM, Brett Cannon <brett at python.org> wrote: >> (FWIW, I think "ModuleManager" is a rather bad name :-) > > I'm open to suggestions, but the thing does manage the module so it at > least makes sense. I suggest ModuleInitialiser as the CM name, with a helper function to make usage read better: with initialisemodule(name) as m: # Module initialisation code goes here # Module is rolled back if initialisation fails

But you're not initializing the module; more like getting the module, either new or from sys.modules. But I thought ModuleGetter seemed too Java-like. Could hide the class behind a get_module function though.

Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130529/21fae9f9/attachment.html>



More information about the Python-Dev mailing list