Kaydet (Commit) f7476c50 authored tarafından Guido van Rossum's avatar Guido van Rossum

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

üst 06d74418
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment