Package mvpa :: Package misc :: Module state :: Class Stateful
[hide private]
[frames] | no frames]

Class Stateful

source code


Base class for stateful objects.

Classes inherited from this class gain ability to provide state
variables, accessed as simple properties. Access to state variables
"internals" is done via states property and interface of
`StateCollection`.

NB This one is to replace old State base class
TODO: rename 'descr'? -- it should simply
      be 'doc' -- no need to drag classes docstring imho.

Nested Classes [hide private]
  __metaclass__
Intended to collect and compose StateCollection for any child class of this metaclass
Instance Methods [hide private]
 
__getattribute__(self, index)
x.__getattribute__('name') <==> x.name
source code
 
__init__(self, enable_states=None, disable_states=None, descr=None)
Initialize Stateful object
source code
 
__repr__(self)
repr(x)
source code
 
__setattr__(self, index, value)
x.__setattr__('name', value) <==> x.name = value
source code
 
__str__(self)
str(x)
source code
 
reset(self) source code

Inherited from object: __delattr__, __hash__, __new__, __reduce__, __reduce_ex__

Class Variables [hide private]
  _collections_template = {}
  _initargs = ['enable_states', 'disable_states', 'descr']
Initialization parameters which should be passed to Statefull
Properties [hide private]
  descr
Description of the object if any

Inherited from object: __class__

Method Details [hide private]

__getattribute__(self, index)

source code 
x.__getattribute__('name') <==> x.name
Overrides: object.__getattribute__
(inherited documentation)

__init__(self, enable_states=None, disable_states=None, descr=None)
(Constructor)

source code 
Initialize Stateful object
Parameters:
  • enable_states (None or list of basestring) - Names of the state variables which should be enabled additionally to default ones
  • disable_states (None or list of basestring) - Names of the state variables which should be disabled
  • descr (basestring) - Description of the instance
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: object.__repr__
(inherited documentation)

__setattr__(self, index, value)

source code 
x.__setattr__('name', value) <==> x.name = value
Overrides: object.__setattr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 
str(x)
Overrides: object.__str__
(inherited documentation)

Property Details [hide private]

descr

Description of the object if any
Get Method:
unreachable(self)