def postfixes(seq):
 n = len(seq)
 for i in range(n):
  (yield seq[((n - i) - 1):])

def postfixes ( seq ) : n = len ( seq ) for i in range ( n ) : ( yield seq [ ( ( n - i ) - 1 ) : ] )
generate all postfixes of a sequence .