Package mdp :: Class Node :: Class __metaclass__
[hide private]
[frames] | no frames]

Type __metaclass__


This Metaclass is meant to overwrite doc strings of methods like
execute, stop_training, inverse with the ones defined in the corresponding
private methods _execute, _stop_training, _inverse, etc...

This makes it possible for subclasses of Node to document the usage
of public methods, without the need to overwrite the ancestor's methods.

Instance Methods [hide private]

Inherited from type: __call__, __cmp__, __delattr__, __getattribute__, __hash__, __repr__, __setattr__, __subclasses__, mro

Inherited from object: __init__, __reduce__, __reduce_ex__, __str__

Static Methods [hide private]
a new object with type S, a subtype of T

__new__(cls, classname, bases, members)
 
_get_infodict(func)
Returns an info dictionary containing: - name (the name of the function : str) - argnames (the names of the arguments : list) - defaults (the values of the default arguments : tuple) - signature (the signature : str) - doc (the docstring : str) - module (the module name : str) - dict (the function __dict__ : str)
 
_wrap_function(original_func, wrapper_infodict)
Return a wrapped version of func.
 
_wrap_method(wrapper_infodict, cls)
Return a wrapped version of func.
Class Variables [hide private]
  DOC_METHODS = ['_train', '_stop_training', '_execute', '_inver...
Properties [hide private]

Inherited from type: __base__, __bases__, __basicsize__, __dictoffset__, __flags__, __itemsize__, __mro__, __name__, __weakrefoffset__

Inherited from object: __class__

Method Details [hide private]

__new__(cls, classname, bases, members)
Static Method

 


Returns:
a new object with type S, a subtype of T

Overrides: object.__new__
(inherited documentation)

_get_infodict(func)
Static Method

 

Returns an info dictionary containing:
- name (the name of the function : str)
- argnames (the names of the arguments : list)
- defaults (the values of the default arguments : tuple)
- signature (the signature : str)
- doc (the docstring : str)
- module (the module name : str)
- dict (the function __dict__ : str)

>>> def f(self, x=1, y=2, *args, **kw): pass

>>> info = getinfo(f)

>>> info["name"]
'f'
>>> info["argnames"]
['self', 'x', 'y', 'args', 'kw']

>>> info["defaults"]
(1, 2)

>>> info["signature"]
'self, x, y, *args, **kw'

_wrap_function(original_func, wrapper_infodict)
Static Method

 
Return a wrapped version of func.

original_func -- The function to be wrapped.
wrapper_infodict -- The infodict to be used for constructing the
    wrapper.

_wrap_method(wrapper_infodict, cls)
Static Method

 
Return a wrapped version of func.

wrapper_infodict -- The infodict to be used for constructing the
    wrapper.
cls -- Class to which the wrapper method will be added, this is used
    for the super call.


Class Variable Details [hide private]

DOC_METHODS

Value:
['_train', '_stop_training', '_execute', '_inverse']