def accumulateClassDict(classObj, attr, adict, baseClass=None):
 for base in classObj.__bases__:
  accumulateClassDict(base, attr, adict)
 if ((baseClass is None) or (baseClass in classObj.__bases__)):
  adict.update(classObj.__dict__.get(attr, {}))

def accumulateClassDict ( classObj , attr , adict , baseClass = None ) : for base in classObj . __bases__ : accumulateClassDict ( base , attr , adict ) if ( ( baseClass is None ) or ( baseClass in classObj . __bases__ ) ) : adict . update ( classObj . __dict__ . get ( attr , { } ) )
accumulate all attributes of a given name in a class heirarchy into a single dictionary .