Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 543f243 commit 6df27f8Copy full SHA for 6df27f8
1 file changed
Lib/socket.py
@@ -228,10 +228,14 @@ def readline(self, limit=-1):
228
data, self._rbuf = self._rbuf[:i], self._rbuf[i:]
229
return data
230
231
- def readlines(self):
+ def readlines(self, sizehint = 0):
232
+ total = 0
233
list = []
234
while 1:
235
line = self.readline()
236
if not line: break
237
list.append(line)
238
+ total += len(line)
239
+ if sizehint and total >= sizehint:
240
+ break
241
return list
0 commit comments