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

Skip to content

Commit bb2e9c4

Browse files
author
Victor Stinner
committed
Issue #11231: Fix bytes and bytearray docstrings
Patch written by Brice Berna.
1 parent e83f899 commit bb2e9c4

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Andrew Bennetts
8080
Andy Bensky
8181
Michel Van den Bergh
8282
Julian Berman
83+
Brice Berna
8384
Eric Beser
8485
Steven Bethard
8586
Stephen Bevan

Objects/bytearrayobject.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,18 +2797,16 @@ bytearray_methods[] = {
27972797
PyDoc_STRVAR(bytearray_doc,
27982798
"bytearray(iterable_of_ints) -> bytearray\n\
27992799
bytearray(string, encoding[, errors]) -> bytearray\n\
2800-
bytearray(bytes_or_bytearray) -> mutable copy of bytes_or_bytearray\n\
2801-
bytearray(memory_view) -> bytearray\n\
2800+
bytearray(bytes_or_buffer) -> mutable copy of bytes_or_buffer\n\
2801+
bytearray(int) -> bytes array of size given by the parameter initialized with null bytes\n\
2802+
bytearray() -> empty bytes array\n\
28022803
\n\
28032804
Construct an mutable bytearray object from:\n\
28042805
- an iterable yielding integers in range(256)\n\
28052806
- a text string encoded using the specified encoding\n\
2806-
- a bytes or a bytearray object\n\
2807+
- a bytes or a buffer object\n\
28072808
- any object implementing the buffer API.\n\
2808-
\n\
2809-
bytearray(int) -> bytearray\n\
2810-
\n\
2811-
Construct a zero-initialized bytearray of the given length.");
2809+
- an integer");
28122810

28132811

28142812
static PyObject *bytearray_iter(PyObject *seq);

Objects/bytesobject.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2721,13 +2721,14 @@ PyDoc_STRVAR(bytes_doc,
27212721
"bytes(iterable_of_ints) -> bytes\n\
27222722
bytes(string, encoding[, errors]) -> bytes\n\
27232723
bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\n\
2724-
bytes(memory_view) -> bytes\n\
2724+
bytes(int) -> bytes object of size given by the parameter initialized with null bytes\n\
2725+
bytes() -> empty bytes object\n\
27252726
\n\
27262727
Construct an immutable array of bytes from:\n\
27272728
- an iterable yielding integers in range(256)\n\
27282729
- a text string encoded using the specified encoding\n\
2729-
- a bytes or a buffer object\n\
2730-
- any object implementing the buffer API.");
2730+
- any object implementing the buffer API.\n\
2731+
- an integer");
27312732

27322733
static PyObject *bytes_iter(PyObject *seq);
27332734

0 commit comments

Comments
 (0)