From f7476c5088e6f459f866901219e1b5b084fb0750 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 25 Jan 1996 17:34:14 +0000 Subject: fix default arg for read() -- should be -1 --- Lib/StringIO.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/StringIO.py b/Lib/StringIO.py index 90f848a..12d19a1 100644 --- a/Lib/StringIO.py +++ b/Lib/StringIO.py @@ -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)) -- cgit v0.12