code: def iterclass(cls):
      
      for field in dir(cls):
          if hasattr(cls, field):
              value = getattr(cls, field)
              yield field, value
docs: Iterates over (valid) attributes of a class.
  
      Args:
          cls (object): the class to iterate over
  
      Yields:
          (str, obj) tuples: the class-level attributes.