fix default arg for read() -- should be -1

This commit is contained in:
Guido van Rossum 1996-01-25 17:34:14 +00:00
parent 06d74418e5
commit f7476c5088
1 changed files with 2 additions and 2 deletions

View File

@ -48,8 +48,8 @@ class StringIO:
self.pos = max(0, pos)
def tell(self):
return self.pos
def read(self, n = 0):
if n <= 0:
def read(self, n = -1):
if n < 0:
newpos = len(self.buf)
else:
newpos = min(self.pos+n, len(self.buf))