def iterate_attributes(cls):
 keys = dir(cls)
 for key in keys:
  for c in cls.__mro__:
   if (key in c.__dict__):
    (yield (key, c.__dict__[key]))
    break

def iterate_attributes ( cls ) : keys = dir ( cls ) for key in keys : for c in cls . __mro__ : if ( key in c . __dict__ ) : ( yield ( key , c . __dict__ [ key ] ) ) break
iterate all the keys and attributes associated with a class .