Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f91197c

Browse files
committed
More docstring fixes, and an XXX.
1 parent 67b8cad commit f91197c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Lib/io.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ def tell(self) -> int:
257257
return self.seek(0, 1)
258258

259259
def truncate(self, pos: int = None) -> int:
260-
"""truncate(size: int = None) -> int. Truncate file to size bytes.
260+
"""truncate(pos: int = None) -> int. Truncate file to pos bytes.
261261
262-
Size defaults to the current IO position as reported by tell().
262+
Pos defaults to the current IO position as reported by tell().
263263
Returns the new size.
264264
"""
265265
self._unsupported("truncate")
@@ -465,7 +465,7 @@ class RawIOBase(IOBase):
465465
def read(self, n: int = -1) -> bytes:
466466
"""read(n: int) -> bytes. Read and return up to n bytes.
467467
468-
Returns an empty bytes array on EOF, or None if the object is
468+
Returns an empty bytes object on EOF, or None if the object is
469469
set not to block and has no data to read.
470470
"""
471471
if n is None:
@@ -478,7 +478,7 @@ def read(self, n: int = -1) -> bytes:
478478
return bytes(b)
479479

480480
def readall(self):
481-
"""readall() -> bytes. Read until EOF, using multiple read() call."""
481+
"""readall() -> bytes. Read until EOF, using multiple read() calls."""
482482
res = bytearray()
483483
while True:
484484
data = self.read(DEFAULT_BUFFER_SIZE)
@@ -521,6 +521,7 @@ def close(self):
521521
def name(self):
522522
return self._name
523523

524+
# XXX(gb): _FileIO already has a mode property
524525
@property
525526
def mode(self):
526527
return self._mode

0 commit comments

Comments
 (0)