code: def all_substrings(s):
      ''' yields all substrings of a string '''
      join = ''.join
      for i in range(1, len(s) + 1):
          for sub in window(s, i):
              yield join(subf all_substrings(s):
      ''' yields all substrings of a string '''
      join = ''.join
      for i in range(1, len(s) + 1):
          for sub in window(s, i):
              yield join(sub)
docs: yields all substrings of a string