def read(self, n=-1):
        if self.ptr >= len(self.str):
            return ""
        p = self.ptr
        assert p >= 0
        if n == -1 or n >= (len(self.str) - self.ptr):
            self.ptr = len(self.str)
            assert self.ptr >= 0
            return self.str[p:]
        else:
            self.ptr += n
            stop = self.ptr
            assert stop < len(self.str)
            assert stop >= 0
            return self.str[p:stop]
dataset/ETHPy150Open samth/pycket/pycket/values.py/W_StringInputPort.read/original