Package mdp :: Class extension
[hide private]
[frames] | no frames]

type extension


Context manager for MDP extension.

This allows you to use extensions using a ``with`` statement, as in:

>>> with mdp.extension('extension_name'):
...     # 'node' is executed with the extension activated
...     node.execute(x)

It is also possible to activate multiple extensions at once:

>>> with mdp.extension(['ext1', 'ext2']):
...     # 'node' is executed with the two extensions activated
...     node.execute(x)
    
The deactivation at the end happens only for the extensions that were
activated by this context manager (not for those that were already active
when the context was entered). This prevents unintended side effects.

Instance Methods [hide private]
 
__enter__(self)
 
__exit__(self, type, value, traceback)
 
__init__(self, ext_names)

Inherited from unreachable.newobject: __long__, __native__, __nonzero__, __unicode__, next

Method Details [hide private]

__enter__(self)

 

__exit__(self, type, value, traceback)

 

__init__(self, ext_names)
(Constructor)

 
Overrides: object.__init__
(inherited documentation)