Skip to content

Commit 730fc6a

Browse files
[3.14] gh-150285: Fix too long docstrings in builtins (GH-150293) (GH-150466)
(cherry picked from commit e1e06be)
1 parent 1e72dfa commit 730fc6a

23 files changed

Lines changed: 580 additions & 509 deletions

Objects/bytearrayobject.c

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,14 +1588,15 @@ bytearray.translate
15881588
15891589
Return a copy with each character mapped by the given translation table.
15901590
1591-
All characters occurring in the optional argument delete are removed.
1592-
The remaining characters are mapped through the given translation table.
1591+
All characters occurring in the optional argument delete are
1592+
removed. The remaining characters are mapped through the given
1593+
translation table.
15931594
[clinic start generated code]*/
15941595

15951596
static PyObject *
15961597
bytearray_translate_impl(PyByteArrayObject *self, PyObject *table,
15971598
PyObject *deletechars)
1598-
/*[clinic end generated code: output=b6a8f01c2a74e446 input=cd6fa93ca04e05bc]*/
1599+
/*[clinic end generated code: output=b6a8f01c2a74e446 input=e5b770ffaf0e40eb]*/
15991600
{
16001601
char *input, *output;
16011602
const char *table_chars;
@@ -1693,15 +1694,15 @@ bytearray.maketrans
16931694
16941695
Return a translation table usable for the bytes or bytearray translate method.
16951696
1696-
The returned table will be one where each byte in frm is mapped to the byte at
1697-
the same position in to.
1697+
The returned table will be one where each byte in frm is mapped to
1698+
the byte at the same position in to.
16981699
16991700
The bytes objects frm and to must be of the same length.
17001701
[clinic start generated code]*/
17011702

17021703
static PyObject *
17031704
bytearray_maketrans_impl(Py_buffer *frm, Py_buffer *to)
1704-
/*[clinic end generated code: output=1df267d99f56b15e input=b10de38c85950a63]*/
1705+
/*[clinic end generated code: output=1df267d99f56b15e input=b1e7b0acbbaeb48a]*/
17051706
{
17061707
return _Py_bytes_maketrans(frm, to);
17071708
}
@@ -1740,8 +1741,8 @@ bytearray.split
17401741
17411742
sep: object = None
17421743
The delimiter according which to split the bytearray.
1743-
None (the default value) means split on ASCII whitespace characters
1744-
(space, tab, return, newline, formfeed, vertical tab).
1744+
None (the default value) means split on ASCII whitespace
1745+
characters (space, tab, return, newline, formfeed, vertical tab).
17451746
maxsplit: Py_ssize_t = -1
17461747
Maximum number of splits to do.
17471748
-1 (the default value) means no limit.
@@ -1752,7 +1753,7 @@ Return a list of the sections in the bytearray, using sep as the delimiter.
17521753
static PyObject *
17531754
bytearray_split_impl(PyByteArrayObject *self, PyObject *sep,
17541755
Py_ssize_t maxsplit)
1755-
/*[clinic end generated code: output=833e2cf385d9a04d input=1c367486b9938909]*/
1756+
/*[clinic end generated code: output=833e2cf385d9a04d input=8776ed42f71b707f]*/
17561757
{
17571758
PyObject *list = NULL;
17581759

@@ -1792,17 +1793,18 @@ bytearray.partition
17921793
17931794
Partition the bytearray into three parts using the given separator.
17941795
1795-
This will search for the separator sep in the bytearray. If the separator is
1796-
found, returns a 3-tuple containing the part before the separator, the
1797-
separator itself, and the part after it as new bytearray objects.
1796+
This will search for the separator sep in the bytearray. If the
1797+
separator is found, returns a 3-tuple containing the part before the
1798+
separator, the separator itself, and the part after it as new
1799+
bytearray objects.
17981800
1799-
If the separator is not found, returns a 3-tuple containing the copy of the
1800-
original bytearray object and two empty bytearray objects.
1801+
If the separator is not found, returns a 3-tuple containing the copy
1802+
of the original bytearray object and two empty bytearray objects.
18011803
[clinic start generated code]*/
18021804

18031805
static PyObject *
18041806
bytearray_partition_impl(PyByteArrayObject *self, PyObject *sep)
1805-
/*[clinic end generated code: output=b5fa1e03f10cfccb input=632855f986733f34]*/
1807+
/*[clinic end generated code: output=b5fa1e03f10cfccb input=d76673ed03acf5dd]*/
18061808
{
18071809
PyObject *bytesep, *result;
18081810

@@ -1830,18 +1832,19 @@ bytearray.rpartition
18301832
18311833
Partition the bytearray into three parts using the given separator.
18321834
1833-
This will search for the separator sep in the bytearray, starting at the end.
1834-
If the separator is found, returns a 3-tuple containing the part before the
1835-
separator, the separator itself, and the part after it as new bytearray
1836-
objects.
1835+
This will search for the separator sep in the bytearray, starting at
1836+
the end. If the separator is found, returns a 3-tuple containing
1837+
the part before the separator, the separator itself, and the part
1838+
after it as new bytearray objects.
18371839
1838-
If the separator is not found, returns a 3-tuple containing two empty bytearray
1839-
objects and the copy of the original bytearray object.
1840+
If the separator is not found, returns a 3-tuple containing two
1841+
empty bytearray objects and the copy of the original bytearray
1842+
object.
18401843
[clinic start generated code]*/
18411844

18421845
static PyObject *
18431846
bytearray_rpartition_impl(PyByteArrayObject *self, PyObject *sep)
1844-
/*[clinic end generated code: output=0186ce7b1ef61289 input=4318e3d125497450]*/
1847+
/*[clinic end generated code: output=0186ce7b1ef61289 input=b9216a2074174a36]*/
18451848
{
18461849
PyObject *bytesep, *result;
18471850

@@ -1866,13 +1869,14 @@ bytearray.rsplit = bytearray.split
18661869
18671870
Return a list of the sections in the bytearray, using sep as the delimiter.
18681871
1869-
Splitting is done starting at the end of the bytearray and working to the front.
1872+
Splitting is done starting at the end of the bytearray and working
1873+
to the front.
18701874
[clinic start generated code]*/
18711875

18721876
static PyObject *
18731877
bytearray_rsplit_impl(PyByteArrayObject *self, PyObject *sep,
18741878
Py_ssize_t maxsplit)
1875-
/*[clinic end generated code: output=a55e0b5a03cb6190 input=3cd513c2b94a53c1]*/
1879+
/*[clinic end generated code: output=a55e0b5a03cb6190 input=c12efb1a77e16c90]*/
18761880
{
18771881
PyObject *list = NULL;
18781882

@@ -2360,12 +2364,13 @@ bytearray.strip
23602364
23612365
Strip leading and trailing bytes contained in the argument.
23622366
2363-
If the argument is omitted or None, strip leading and trailing ASCII whitespace.
2367+
If the argument is omitted or None, strip leading and trailing ASCII
2368+
whitespace.
23642369
[clinic start generated code]*/
23652370

23662371
static PyObject *
23672372
bytearray_strip_impl(PyByteArrayObject *self, PyObject *bytes)
2368-
/*[clinic end generated code: output=760412661a34ad5a input=1f9026e5ad35388a]*/
2373+
/*[clinic end generated code: output=760412661a34ad5a input=f4ec5fa609df7d14]*/
23692374
{
23702375
return bytearray_strip_impl_helper(self, bytes, BOTHSTRIP);
23712376
}
@@ -2465,19 +2470,19 @@ bytearray.decode
24652470
encoding: str(c_default="NULL") = 'utf-8'
24662471
The encoding with which to decode the bytearray.
24672472
errors: str(c_default="NULL") = 'strict'
2468-
The error handling scheme to use for the handling of decoding errors.
2469-
The default is 'strict' meaning that decoding errors raise a
2470-
UnicodeDecodeError. Other possible values are 'ignore' and 'replace'
2471-
as well as any other name registered with codecs.register_error that
2472-
can handle UnicodeDecodeErrors.
2473+
The error handling scheme to use for the handling of decoding
2474+
errors. The default is 'strict' meaning that decoding errors
2475+
raise a UnicodeDecodeError. Other possible values are 'ignore'
2476+
and 'replace' as well as any other name registered with
2477+
codecs.register_error that can handle UnicodeDecodeErrors.
24732478
24742479
Decode the bytearray using the codec registered for encoding.
24752480
[clinic start generated code]*/
24762481

24772482
static PyObject *
24782483
bytearray_decode_impl(PyByteArrayObject *self, const char *encoding,
24792484
const char *errors)
2480-
/*[clinic end generated code: output=f57d43f4a00b42c5 input=86c303ee376b8453]*/
2485+
/*[clinic end generated code: output=f57d43f4a00b42c5 input=e51ce9b82b51e2ca]*/
24812486
{
24822487
if (encoding == NULL)
24832488
encoding = PyUnicode_GetDefaultEncoding();
@@ -2505,14 +2510,15 @@ bytearray.join
25052510
25062511
Concatenate any number of bytes/bytearray objects.
25072512
2508-
The bytearray whose method is called is inserted in between each pair.
2513+
The bytearray whose method is called is inserted in between each
2514+
pair.
25092515
25102516
The result is returned as a new bytearray object.
25112517
[clinic start generated code]*/
25122518

25132519
static PyObject *
25142520
bytearray_join_impl(PyByteArrayObject *self, PyObject *iterable_of_bytes)
2515-
/*[clinic end generated code: output=0ced382b5846a7ee input=49627e07ca31ca26]*/
2521+
/*[clinic end generated code: output=0ced382b5846a7ee input=0a31db349efcd7fa]*/
25162522
{
25172523
PyObject *ret;
25182524
self->ob_exports++; // this protects `self` from being cleared/resized if `iterable_of_bytes` is a custom iterator
@@ -2549,13 +2555,13 @@ bytearray.splitlines
25492555
25502556
Return a list of the lines in the bytearray, breaking at line boundaries.
25512557
2552-
Line breaks are not included in the resulting list unless keepends is given and
2553-
true.
2558+
Line breaks are not included in the resulting list unless keepends
2559+
is given and true.
25542560
[clinic start generated code]*/
25552561

25562562
static PyObject *
25572563
bytearray_splitlines_impl(PyByteArrayObject *self, int keepends)
2558-
/*[clinic end generated code: output=4223c94b895f6ad9 input=874cd662866a66a1]*/
2564+
/*[clinic end generated code: output=4223c94b895f6ad9 input=73512aabe215e0ec]*/
25592565
{
25602566
return stringlib_splitlines(
25612567
(PyObject*) self, PyByteArray_AS_STRING(self),
@@ -2573,12 +2579,13 @@ bytearray.fromhex
25732579
Create a bytearray object from a string of hexadecimal numbers.
25742580
25752581
Spaces between two numbers are accepted.
2576-
Example: bytearray.fromhex('B9 01EF') -> bytearray(b'\\xb9\\x01\\xef')
2582+
Example:
2583+
bytearray.fromhex('B9 01EF') -> bytearray(b'\\xb9\\x01\\xef')
25772584
[clinic start generated code]*/
25782585

25792586
static PyObject *
25802587
bytearray_fromhex_impl(PyTypeObject *type, PyObject *string)
2581-
/*[clinic end generated code: output=8f0f0b6d30fb3ba0 input=7e314e5b2d7ab484]*/
2588+
/*[clinic end generated code: output=8f0f0b6d30fb3ba0 input=2243a8b0b9e66cd5]*/
25822589
{
25832590
PyObject *result = _PyBytes_FromHex(string, type == &PyByteArray_Type);
25842591
if (type != &PyByteArray_Type && result != NULL) {
@@ -2594,8 +2601,8 @@ bytearray.hex
25942601
sep: object = NULL
25952602
An optional single character or byte to separate hex bytes.
25962603
bytes_per_sep: int = 1
2597-
How many bytes between separators. Positive values count from the
2598-
right, negative values count from the left.
2604+
How many bytes between separators. Positive values count from
2605+
the right, negative values count from the left.
25992606
26002607
Create a string of hexadecimal numbers from a bytearray object.
26012608
@@ -2613,7 +2620,7 @@ Create a string of hexadecimal numbers from a bytearray object.
26132620

26142621
static PyObject *
26152622
bytearray_hex_impl(PyByteArrayObject *self, PyObject *sep, int bytes_per_sep)
2616-
/*[clinic end generated code: output=29c4e5ef72c565a0 input=7784107de7048873]*/
2623+
/*[clinic end generated code: output=29c4e5ef72c565a0 input=88d6628560fdd413]*/
26172624
{
26182625
char* argbuf = PyByteArray_AS_STRING(self);
26192626
Py_ssize_t arglen = PyByteArray_GET_SIZE(self);

Objects/bytes_methods.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len)
277277
PyDoc_STRVAR_shared(_Py_title__doc__,
278278
"B.title() -> copy of B\n\
279279
\n\
280-
Return a titlecased version of B, i.e. ASCII words start with uppercase\n\
281-
characters, all remaining cased characters have lowercase.");
280+
Return a titlecased version of B, i.e. ASCII words start with\n\
281+
uppercase characters, all remaining cased characters have lowercase.");
282282

283283
void
284284
_Py_bytes_title(char *result, const char *s, Py_ssize_t len)

0 commit comments

Comments
 (0)