def accumulateMethods(obj, dict, prefix='', curClass=None):
 if (not curClass):
  curClass = obj.__class__
 for base in curClass.__bases__:
  accumulateMethods(obj, dict, prefix, base)
 for (name, method) in curClass.__dict__.items():
  optName = name[len(prefix):]
  if ((type(method) is types.FunctionType) and (name[:len(prefix)] == prefix) and len(optName)):
   dict[optName] = getattr(obj, name)

def accumulateMethods ( obj , dict , prefix = '' , curClass = None ) : if ( not curClass ) : curClass = obj . __class__ for base in curClass . __bases__ : accumulateMethods ( obj , dict , prefix , base ) for ( name , method ) in curClass . __dict__ . items ( ) : optName = name [ len ( prefix ) : ] if ( ( type ( method ) is types . FunctionType ) and ( name [ : len ( prefix ) ] == prefix ) and len ( optName ) ) : dict [ optName ] = getattr ( obj , name )
given an object c{obj} .