def charsUntil(self, characters, opposite=False):
<EOL>try:<EOL><INDENT>chars = charsUntilRegEx[(characters, opposite)]<EOL><DEDENT>except KeyError:<EOL><INDENT>if __debug__:<EOL><INDENT>for c in characters:<EOL><INDENT>assert(ord(c) < <NUM_LIT>)<EOL><DEDENT><DEDENT>regex = "<STR_LIT>".join(["<STR_LIT>" % ord(c) for c in characters])<EOL>if not opposite:<EOL><INDENT>regex = "<STR_LIT>" % regex<EOL><DEDENT>chars = charsUntilRegEx[(characters, opposite)] = re.compile("<STR_LIT>" % regex)<EOL><DEDENT>rv = []<EOL>while True:<EOL><INDENT>m = chars.match(self.chunk, self.chunkOffset)<EOL>if m is None:<EOL><INDENT>if self.chunkOffset != self.chunkSize:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>end = m.end()<EOL>if end != self.chunkSize:<EOL><INDENT>rv.append(self.chunk[self.chunkOffset:end])<EOL>self.chunkOffset = end<EOL>break<EOL><DEDENT><DEDENT>rv.append(self.chunk[self.chunkOffset:])<EOL>if not self.readChunk():<EOL><INDENT>break<EOL><DEDENT><DEDENT>r = "<STR_LIT>".join(rv)<EOL>return r<EOL>
Returns a string of characters from the stream up to but not
        including any character in 'characters' or EOF. 'characters' must be
        a container that supports the 'in' method and iteration over its
        characters.