def accumulate_dict_from_superclasses(cls, propname):
 cachename = ('__cached_all' + propname)
 if (cachename not in cls.__dict__):
  d = dict()
  for c in inspect.getmro(cls):
   if (issubclass(c, HasProps) and hasattr(c, propname)):
    base = getattr(c, propname)
    for (k, v) in base.items():
     if (k not in d):
      d[k] = v
  setattr(cls, cachename, d)
 return cls.__dict__[cachename]

def accumulate_dict_from_superclasses ( cls , propname ) : cachename = ( '__cached_all' + propname ) if ( cachename not in cls . __dict__ ) : d = dict ( ) for c in inspect . getmro ( cls ) : if ( issubclass ( c , HasProps ) and hasattr ( c , propname ) ) : base = getattr ( c , propname ) for ( k , v ) in base . items ( ) : if ( k not in d ) : d [ k ] = v setattr ( cls , cachename , d ) return cls . __dict__ [ cachename ]
traverse the class hierarchy and accumulate the special dicts metahasprops stores on classes: args: name : name of the special attribute to collect .