summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-12-17 23:18:07 +0100
committerVictor Stinner <victor.stinner@haypocalc.com>2011-12-17 23:18:07 +0100
commit091d4329f886261808458c597ecae9f8611f39b8 (patch)
treee713b2f750c19715eb7e3ceef552b7486fc6475e /Objects
parent7e44144c2cc748f140e2f086d6f98ec8c5102b2c (diff)
downloadcpython-091d4329f886261808458c597ecae9f8611f39b8.tar.gz
Issue #11231: Fix bytes and bytearray docstrings
Patch written by Brice Berna.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bytearrayobject.c12
-rw-r--r--Objects/bytesobject.c7
2 files changed, 9 insertions, 10 deletions
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index 0b45394a4a..4202ff28e4 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -2797,18 +2797,16 @@ bytearray_methods[] = {
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
index 8e35fa9276..b10cb5d3de 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -2721,13 +2721,14 @@ PyDoc_STRVAR(bytes_doc,
"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);