code: def strip_rightmost(self):
          
  
          parts = self.print_str.split("-")
          parts.pop()
          if parts and len(parts[-1]) == 1:
              parts.pop()
          return type(self).fromstr("-".join(parts))
docs: Strip the rightmost part of the language range. If the new rightmost
          part is a singleton or ``x`` (i.e. starts an extension or private use
          part), it is also stripped.
  
          Return the newly created :class:`LanguageRange`.