code: def reversed_dotted_parts(s):
      
      idx = -1
      if s:
          yield s
      while s:
          idx = s.rfind('.', 0, idx)
          if idx == -1:
              break
          yield s[:idx]
docs: For a string "a.b.c", yields "a.b.c", "a.b", "a".