code: def to_dict(cls):
          
          return dict((item.name, item.number) for item in iter(cls))
docs: Make dictionary version of enumerated class.
  
          Dictionary created this way can be used with def_num.
  
          Returns:
            A dict (name) -> number