Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-30 Thread Eric Snow
On Wed, May 29, 2013 at 2:22 PM, Brett Cannon br...@python.org wrote: So module_to_init it is unless someone can convince me the bikeshed is a different colour. Whatever the name is, it should reflect what is happening during the with statement, and more particularly that the thing will end at

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-30 Thread Mark Shannon
On 29/05/13 01:14, Brett Cannon wrote: On Tue, May 28, 2013 at 5:40 PM, Antoine Pitrou solip...@pitrou.net wrote: On Tue, 28 May 2013 23:29:46 +0200 (CEST) brett.cannon python-check...@python.org wrote: +.. class:: ModuleManager(name) + +A :term:`context manager` which provides the

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-30 Thread Alfredo Solano
Hi, What about ModuleProxy? From the dictionary: prox·y /ˈpräksē/ Noun The authority to represent someone else, esp. in voting. A person authorized to act on behalf of another. Synonyms deputy - representative - agent - substitute Alfredo On 05/30/2013 10:34 AM, Mark Shannon wrote: On

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-30 Thread Nick Coghlan
On 30 May 2013 06:25, Brett Cannon br...@python.org wrote: On Wed, May 29, 2013 at 2:56 PM, R. David Murray rdmur...@bitdance.com wrote: On Wed, 29 May 2013 20:10:44 +0200, Antoine Pitrou solip...@pitrou.net wrote: On Wed, 29 May 2013 12:55:01 -0400 Brett Cannon br...@python.org wrote:

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-30 Thread Ron Adam
On 05/30/2013 03:34 AM, Mark Shannon wrote: On 29/05/13 01:14, Brett Cannon wrote: On Tue, May 28, 2013 at 5:40 PM, Antoine Pitrou solip...@pitrou.net wrote: On Tue, 28 May 2013 23:29:46 +0200 (CEST) brett.cannon python-check...@python.org wrote: +.. class:: ModuleManager(name) + +A

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread Brett Cannon
On May 29, 2013 1:09 AM, Nick Coghlan ncogh...@gmail.com wrote: On Wed, May 29, 2013 at 10:14 AM, Brett Cannon br...@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

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread Nick Coghlan
On Wed, May 29, 2013 at 11:04 PM, Brett Cannon br...@python.org wrote: with initialise_module(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

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread Brett Cannon
On Wed, May 29, 2013 at 10:34 AM, Nick Coghlan ncogh...@gmail.com wrote: On Wed, May 29, 2013 at 11:04 PM, Brett Cannon br...@python.org wrote: with initialise_module(name) as m: # Module initialisation code goes here # Module is rolled back if initialisation fails But

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread Nick Coghlan
On Thu, May 30, 2013 at 12:47 AM, Brett Cannon br...@python.org wrote: I am willing to compromise to module_to_initialize, module_to_init, or module_to_load. Pick one. =) I see this as *really* similar to a database transaction, and those start with session.begin(). Could you tolerate with

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread R. David Murray
On Thu, 30 May 2013 00:59:02 +1000, Nick Coghlan ncogh...@gmail.com wrote: On Thu, May 30, 2013 at 12:47 AM, Brett Cannon br...@python.org wrote: I am willing to compromise to module_to_initialize, module_to_init, or module_to_load. Pick one. =) I see this as *really* similar to a database

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread Antoine Pitrou
Le Wed, 29 May 2013 11:58:21 -0400, R. David Murray rdmur...@bitdance.com a écrit : On Thu, 30 May 2013 00:59:02 +1000, Nick Coghlan ncogh...@gmail.com wrote: On Thu, May 30, 2013 at 12:47 AM, Brett Cannon br...@python.org wrote: I am willing to compromise to module_to_initialize,

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread Brett Cannon
On Wed, May 29, 2013 at 11:58 AM, R. David Murray rdmur...@bitdance.com wrote: On Thu, 30 May 2013 00:59:02 +1000, Nick Coghlan ncogh...@gmail.com wrote: On Thu, May 30, 2013 at 12:47 AM, Brett Cannon br...@python.org wrote: I am willing to compromise to module_to_initialize, module_to_init,

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread R. David Murray
On Wed, 29 May 2013 12:25:45 -0400, Brett Cannon br...@python.org wrote: In case you want to suggest a name, the context manager returns the module that should be initialized/loaded. So typical usage will be:: class Loader: def load_module(self, fullname): with

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread Brett Cannon
On Wed, May 29, 2013 at 12:49 PM, R. David Murray rdmur...@bitdance.com wrote: On Wed, 29 May 2013 12:25:45 -0400, Brett Cannon br...@python.org wrote: In case you want to suggest a name, the context manager returns the module that should be initialized/loaded. So typical usage will be::

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread Antoine Pitrou
On Wed, 29 May 2013 12:55:01 -0400 Brett Cannon br...@python.org wrote: Perhaps 'managed_module'? managed_module is better than managed_initialization. I don't understand how it's managed. manage, manager, etc. is the kind of dumb words everybody uses when they don't manage (!) to explain

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread R. David Murray
On Wed, 29 May 2013 20:10:44 +0200, Antoine Pitrou solip...@pitrou.net wrote: On Wed, 29 May 2013 12:55:01 -0400 Brett Cannon br...@python.org wrote: Perhaps 'managed_module'? managed_module is better than managed_initialization. I don't understand how it's managed. manage, manager,

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread R. David Murray
On Wed, 29 May 2013 20:10:44 +0200, Antoine Pitrou solip...@pitrou.net wrote: On Wed, 29 May 2013 12:55:01 -0400 Brett Cannon br...@python.org wrote: Perhaps 'managed_module'? managed_module is better than managed_initialization. I don't understand how it's managed. manage, manager,

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread Brett Cannon
On Wed, May 29, 2013 at 2:56 PM, R. David Murray rdmur...@bitdance.com wrote: On Wed, 29 May 2013 20:10:44 +0200, Antoine Pitrou solip...@pitrou.net wrote: On Wed, 29 May 2013 12:55:01 -0400 Brett Cannon br...@python.org wrote: Perhaps 'managed_module'? managed_module is better than

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-29 Thread Eric Snow
On Wed, May 29, 2013 at 10:49 AM, R. David Murray rdmur...@bitdance.com wrote: Perhaps 'managed_module'? I was just thinking the same thing. -eric ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-28 Thread Antoine Pitrou
On Tue, 28 May 2013 23:29:46 +0200 (CEST) brett.cannon python-check...@python.org wrote: +.. class:: ModuleManager(name) + +A :term:`context manager` which provides the module to load. The module will +either come from :attr:`sys.modules` in the case of reloading or a fresh +

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-28 Thread Brett Cannon
On Tue, May 28, 2013 at 5:40 PM, Antoine Pitrou solip...@pitrou.net wrote: On Tue, 28 May 2013 23:29:46 +0200 (CEST) brett.cannon python-check...@python.org wrote: +.. class:: ModuleManager(name) + +A :term:`context manager` which provides the module to load. The module will +

Re: [Python-Dev] cpython: Introduce importlib.util.ModuleManager which is a context manager to

2013-05-28 Thread Nick Coghlan
On Wed, May 29, 2013 at 10:14 AM, Brett Cannon br...@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