[Python-checkins] cpython (merge 3.4 -> default): Issue #21860: Correct docstrings of FileIO.seek() and FileIO.truncate() methods.

berker.peksag python-checkins at python.org
Wed Sep 24 11:44:09 CEST 2014


https://hg.python.org/cpython/rev/de645efe6a9b
changeset:   92557:de645efe6a9b
parent:      92555:064f6baeb6bd
parent:      92556:2058d94f32dd
user:        Berker Peksag <berker.peksag at gmail.com>
date:        Wed Sep 24 12:44:06 2014 +0300
summary:
  Issue #21860: Correct docstrings of FileIO.seek() and FileIO.truncate() methods.

Patch by Terry Chia.

files:
  Misc/ACKS            |  1 +
  Modules/_io/fileio.c |  8 +++++---
  2 files changed, 6 insertions(+), 3 deletions(-)


diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -239,6 +239,7 @@
 Jerry Chen
 Michael Chermside
 Ingrid Cheung
+Terry Chia
 Albert Chin-A-Young
 Adal Chiriliuc
 Matt Chisholm
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -1127,7 +1127,8 @@
 "This is needed for lower-level file interfaces, such the fcntl module.");
 
 PyDoc_STRVAR(seek_doc,
-"seek(offset: int[, whence: int]) -> None.  Move to new file position.\n"
+"seek(offset: int[, whence: int]) -> int.  Move to new file position and\n"
+"return the file position.\n"
 "\n"
 "Argument offset is a byte count.  Optional argument whence defaults to\n"
 "0 (offset from start of file, offset should be >= 0); other values are 1\n"
@@ -1139,9 +1140,10 @@
 
 #ifdef HAVE_FTRUNCATE
 PyDoc_STRVAR(truncate_doc,
-"truncate([size: int]) -> None.  Truncate the file to at most size bytes.\n"
+"truncate([size: int]) -> int.  Truncate the file to at most size bytes\n"
+"and return the truncated size.\n"
 "\n"
-"Size defaults to the current file position, as returned by tell()."
+"Size defaults to the current file position, as returned by tell().\n"
 "The current file position is changed to the value of size.");
 #endif
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list