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

Class 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)
x.__init__(...) initializes x; see help(type(x)) for signature

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

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__enter__(self)

 

__exit__(self, type, value, traceback)

 

__init__(self, ext_names)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)