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