[Python-checkins] cpython (merge 3.2 -> default): Issue #11231: Fix bytes and bytearray docstrings

victor.stinner python-checkins at python.org
Sat Dec 17 23:16:57 CET 2011


http://hg.python.org/cpython/rev/dc670add1e28
changeset: 74021:dc670add1e28
parent: 74019:b05caa600c40
parent: 74020:beac7d6c7be4
user: Victor Stinner <victor.stinner at haypocalc.com>
date: Sat Dec 17 23:18:43 2011 +0100
summary:
 Issue #11231: Fix bytes and bytearray docstrings
Patch written by Brice Berna.
files:
 Misc/ACKS | 1 +
 Objects/bytearrayobject.c | 12 +++++-------
 Objects/bytesobject.c | 7 ++++---
 3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -84,6 +84,7 @@
 Andy Bensky
 Michel Van den Bergh
 Julian Berman
+Brice Berna
 Eric Beser
 Steven Bethard
 Stephen Bevan
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -2890,18 +2890,16 @@
 PyDoc_STRVAR(bytearray_doc,
 "bytearray(iterable_of_ints) -> bytearray\n\
 bytearray(string, encoding[, errors]) -> bytearray\n\
-bytearray(bytes_or_bytearray) -> mutable copy of bytes_or_bytearray\n\
-bytearray(memory_view) -> bytearray\n\
+bytearray(bytes_or_buffer) -> mutable copy of bytes_or_buffer\n\
+bytearray(int) -> bytes array of size given by the parameter initialized with null bytes\n\
+bytearray() -> empty bytes array\n\
 \n\
 Construct an mutable bytearray object from:\n\
 - an iterable yielding integers in range(256)\n\
 - a text string encoded using the specified encoding\n\
- - a bytes or a bytearray object\n\
+ - a bytes or a buffer object\n\
 - any object implementing the buffer API.\n\
-\n\
-bytearray(int) -> bytearray\n\
-\n\
-Construct a zero-initialized bytearray of the given length.");
+ - an integer");
 
 
 static PyObject *bytearray_iter(PyObject *seq);
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -2732,13 +2732,14 @@
 "bytes(iterable_of_ints) -> bytes\n\
 bytes(string, encoding[, errors]) -> bytes\n\
 bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\n\
-bytes(memory_view) -> bytes\n\
+bytes(int) -> bytes object of size given by the parameter initialized with null bytes\n\
+bytes() -> empty bytes object\n\
 \n\
 Construct an immutable array of bytes from:\n\
 - an iterable yielding integers in range(256)\n\
 - a text string encoded using the specified encoding\n\
- - a bytes or a buffer object\n\
- - any object implementing the buffer API.");
+ - any object implementing the buffer API.\n\
+ - an integer");
 
 static PyObject *bytes_iter(PyObject *seq);
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /