code: def is_primary(self):
          
          return bool(next(iter(self.selfsig._signature.subpackets['h_PrimaryUserID']), False))
docs: If the most recent, valid self-signature specifies this as being primary, this will be True. Otherwise, Faqlse.