def checktype_seq(self, seq, kind, *, unique=False, **kargs):
exp = self.str_kind(kind)<EOL>try:<EOL><INDENT>iterator = iter(seq)<EOL>len(seq)<EOL><DEDENT>except TypeError:<EOL><INDENT>got = self.str_valtype(seq)<EOL>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>'.format(exp, got))<EOL><DEDENT>if isinstance(seq, str):<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(exp))<EOL><DEDENT>for i, item in enumerate(iterator):<EOL><INDENT>try:<EOL><INDENT>self.checktype(item, kind, **kargs)<EOL><DEDENT>except TypeError:<EOL><INDENT>got = self.str_valtype(item)<EOL>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>'.format(<EOL>exp, got, i)) from None<EOL><DEDENT><DEDENT>if unique:<EOL><INDENT>seen = []<EOL>for i, item in enumerate(seq):<EOL><INDENT>if item in seen:<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>'.format(repr(item), i))<EOL><DEDENT>seen.append(item)<EOL><DEDENT><DEDENT>
Raise TypeError if seq is not a sequence of elements satisfying
        kind. Optionally require elements to be unique.

        As a special case, a string is considered to be an atomic value
        rather than a sequence of single-character strings. (Thus,
        checktype_seq('foo', str) will fail.)