]> granicus.if.org Git - python/commitdiff
fix default arg for read() -- should be -1
authorGuido van Rossum <guido@python.org>
Thu, 25 Jan 1996 17:34:14 +0000 (17:34 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 25 Jan 1996 17:34:14 +0000 (17:34 +0000)
Lib/StringIO.py

index 90f848a4d556e8effd7be146238b8cd81e6a4332..12d19a1cbff761ee09839f8edd6cf46d5cf6a640 100644 (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))