def _peek(self, n):  # type: (int) -> str
        """
        Peeks ahead n characters.

        n is the max number of characters that will be peeked.
        """
        # we always want to restore after exiting this scope
        with self._state(restore=True):
            buf = ""
            for _ in range(n):
                if self._current not in " \t\n\r#,]}":
                    buf += self._current
                    self.inc()
                    continue

                break
            return buf
Peeks ahead n characters.

        n is the max number of characters that will be peeked.