mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
The Usual
This commit is contained in:
parent
0872e05851
commit
d635b1d724
20 changed files with 643 additions and 422 deletions
|
@ -91,11 +91,15 @@ class StringIO:
|
|||
r = self.buf[self.pos:newpos]
|
||||
self.pos = newpos
|
||||
return r
|
||||
def readlines(self):
|
||||
def readlines(self, sizehint = 0):
|
||||
total = 0
|
||||
lines = []
|
||||
line = self.readline()
|
||||
while line:
|
||||
lines.append(line)
|
||||
total += len(line)
|
||||
if 0 < sizehint <= total:
|
||||
break
|
||||
line = self.readline()
|
||||
return lines
|
||||
def write(self, s):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue