Skip to content

Commit 43b6b48

Browse files
[3.13] gh-150285: Fix too long docstrings in builtins (GH-150293) (GH-150466) (GH-150472)
(cherry picked from commit 730fc6a) (cherry picked from commit e1e06be)
1 parent 96d66ac commit 43b6b48

23 files changed

Lines changed: 578 additions & 507 deletions

Objects/bytearrayobject.c

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,14 +1395,15 @@ bytearray.translate
13951395
13961396
Return a copy with each character mapped by the given translation table.
13971397
1398-
All characters occurring in the optional argument delete are removed.
1399-
The remaining characters are mapped through the given translation table.
1398+
All characters occurring in the optional argument delete are
1399+
removed. The remaining characters are mapped through the given
1400+
translation table.
14001401
[clinic start generated code]*/
14011402

14021403
static PyObject *
14031404
bytearray_translate_impl(PyByteArrayObject *self, PyObject *table,
14041405
PyObject *deletechars)
1405-
/*[clinic end generated code: output=b6a8f01c2a74e446 input=cfff956d4d127a9b]*/
1406+
/*[clinic end generated code: output=b6a8f01c2a74e446 input=50a30905c8c8835c]*/
14061407
{
14071408
char *input, *output;
14081409
const char *table_chars;
@@ -1500,15 +1501,15 @@ bytearray.maketrans
15001501
15011502
Return a translation table usable for the bytes or bytearray translate method.
15021503
1503-
The returned table will be one where each byte in frm is mapped to the byte at
1504-
the same position in to.
1504+
The returned table will be one where each byte in frm is mapped to
1505+
the byte at the same position in to.
15051506
15061507
The bytes objects frm and to must be of the same length.
15071508
[clinic start generated code]*/
15081509

15091510
static PyObject *
15101511
bytearray_maketrans_impl(Py_buffer *frm, Py_buffer *to)
1511-
/*[clinic end generated code: output=1df267d99f56b15e input=b10de38c85950a63]*/
1512+
/*[clinic end generated code: output=1df267d99f56b15e input=b1e7b0acbbaeb48a]*/
15121513
{
15131514
return _Py_bytes_maketrans(frm, to);
15141515
}
@@ -1545,8 +1546,8 @@ bytearray.split
15451546
15461547
sep: object = None
15471548
The delimiter according which to split the bytearray.
1548-
None (the default value) means split on ASCII whitespace characters
1549-
(space, tab, return, newline, formfeed, vertical tab).
1549+
None (the default value) means split on ASCII whitespace
1550+
characters (space, tab, return, newline, formfeed, vertical tab).
15501551
maxsplit: Py_ssize_t = -1
15511552
Maximum number of splits to do.
15521553
-1 (the default value) means no limit.
@@ -1557,7 +1558,7 @@ Return a list of the sections in the bytearray, using sep as the delimiter.
15571558
static PyObject *
15581559
bytearray_split_impl(PyByteArrayObject *self, PyObject *sep,
15591560
Py_ssize_t maxsplit)
1560-
/*[clinic end generated code: output=833e2cf385d9a04d input=24f82669f41bf523]*/
1561+
/*[clinic end generated code: output=833e2cf385d9a04d input=14afd5161c17fb05]*/
15611562
{
15621563
PyObject *list = NULL;
15631564

@@ -1596,17 +1597,18 @@ bytearray.partition
15961597
15971598
Partition the bytearray into three parts using the given separator.
15981599
1599-
This will search for the separator sep in the bytearray. If the separator is
1600-
found, returns a 3-tuple containing the part before the separator, the
1601-
separator itself, and the part after it as new bytearray objects.
1600+
This will search for the separator sep in the bytearray. If the
1601+
separator is found, returns a 3-tuple containing the part before the
1602+
separator, the separator itself, and the part after it as new
1603+
bytearray objects.
16021604
1603-
If the separator is not found, returns a 3-tuple containing the copy of the
1604-
original bytearray object and two empty bytearray objects.
1605+
If the separator is not found, returns a 3-tuple containing the copy
1606+
of the original bytearray object and two empty bytearray objects.
16051607
[clinic start generated code]*/
16061608

16071609
static PyObject *
16081610
bytearray_partition(PyByteArrayObject *self, PyObject *sep)
1609-
/*[clinic end generated code: output=45d2525ddd35f957 input=8f644749ee4fc83a]*/
1611+
/*[clinic end generated code: output=45d2525ddd35f957 input=cba58c2f7620fd20]*/
16101612
{
16111613
PyObject *bytesep, *result;
16121614

@@ -1633,18 +1635,19 @@ bytearray.rpartition
16331635
16341636
Partition the bytearray into three parts using the given separator.
16351637
1636-
This will search for the separator sep in the bytearray, starting at the end.
1637-
If the separator is found, returns a 3-tuple containing the part before the
1638-
separator, the separator itself, and the part after it as new bytearray
1639-
objects.
1638+
This will search for the separator sep in the bytearray, starting at
1639+
the end. If the separator is found, returns a 3-tuple containing
1640+
the part before the separator, the separator itself, and the part
1641+
after it as new bytearray objects.
16401642
1641-
If the separator is not found, returns a 3-tuple containing two empty bytearray
1642-
objects and the copy of the original bytearray object.
1643+
If the separator is not found, returns a 3-tuple containing two
1644+
empty bytearray objects and the copy of the original bytearray
1645+
object.
16431646
[clinic start generated code]*/
16441647

16451648
static PyObject *
16461649
bytearray_rpartition(PyByteArrayObject *self, PyObject *sep)
1647-
/*[clinic end generated code: output=440de3c9426115e8 input=7e3df3e6cb8fa0ac]*/
1650+
/*[clinic end generated code: output=440de3c9426115e8 input=6fb8e0f18e6bb0ec]*/
16481651
{
16491652
PyObject *bytesep, *result;
16501653

@@ -1668,13 +1671,14 @@ bytearray.rsplit = bytearray.split
16681671
16691672
Return a list of the sections in the bytearray, using sep as the delimiter.
16701673
1671-
Splitting is done starting at the end of the bytearray and working to the front.
1674+
Splitting is done starting at the end of the bytearray and working
1675+
to the front.
16721676
[clinic start generated code]*/
16731677

16741678
static PyObject *
16751679
bytearray_rsplit_impl(PyByteArrayObject *self, PyObject *sep,
16761680
Py_ssize_t maxsplit)
1677-
/*[clinic end generated code: output=a55e0b5a03cb6190 input=a68286e4dd692ffe]*/
1681+
/*[clinic end generated code: output=a55e0b5a03cb6190 input=3c6d2e7a19e14c85]*/
16781682
{
16791683
PyObject *list = NULL;
16801684

@@ -2045,12 +2049,13 @@ bytearray.strip
20452049
20462050
Strip leading and trailing bytes contained in the argument.
20472051
2048-
If the argument is omitted or None, strip leading and trailing ASCII whitespace.
2052+
If the argument is omitted or None, strip leading and trailing ASCII
2053+
whitespace.
20492054
[clinic start generated code]*/
20502055

20512056
static PyObject *
20522057
bytearray_strip_impl(PyByteArrayObject *self, PyObject *bytes)
2053-
/*[clinic end generated code: output=760412661a34ad5a input=ef7bb59b09c21d62]*/
2058+
/*[clinic end generated code: output=760412661a34ad5a input=063ca44b1f107843]*/
20542059
{
20552060
return bytearray_strip_impl_helper(self, bytes, BOTHSTRIP);
20562061
}
@@ -2097,19 +2102,19 @@ bytearray.decode
20972102
encoding: str(c_default="NULL") = 'utf-8'
20982103
The encoding with which to decode the bytearray.
20992104
errors: str(c_default="NULL") = 'strict'
2100-
The error handling scheme to use for the handling of decoding errors.
2101-
The default is 'strict' meaning that decoding errors raise a
2102-
UnicodeDecodeError. Other possible values are 'ignore' and 'replace'
2103-
as well as any other name registered with codecs.register_error that
2104-
can handle UnicodeDecodeErrors.
2105+
The error handling scheme to use for the handling of decoding
2106+
errors. The default is 'strict' meaning that decoding errors
2107+
raise a UnicodeDecodeError. Other possible values are 'ignore'
2108+
and 'replace' as well as any other name registered with
2109+
codecs.register_error that can handle UnicodeDecodeErrors.
21052110
21062111
Decode the bytearray using the codec registered for encoding.
21072112
[clinic start generated code]*/
21082113

21092114
static PyObject *
21102115
bytearray_decode_impl(PyByteArrayObject *self, const char *encoding,
21112116
const char *errors)
2112-
/*[clinic end generated code: output=f57d43f4a00b42c5 input=f28d8f903020257b]*/
2117+
/*[clinic end generated code: output=f57d43f4a00b42c5 input=f2f539b09781a267]*/
21132118
{
21142119
if (encoding == NULL)
21152120
encoding = PyUnicode_GetDefaultEncoding();
@@ -2135,14 +2140,15 @@ bytearray.join
21352140
21362141
Concatenate any number of bytes/bytearray objects.
21372142
2138-
The bytearray whose method is called is inserted in between each pair.
2143+
The bytearray whose method is called is inserted in between each
2144+
pair.
21392145
21402146
The result is returned as a new bytearray object.
21412147
[clinic start generated code]*/
21422148

21432149
static PyObject *
21442150
bytearray_join(PyByteArrayObject *self, PyObject *iterable_of_bytes)
2145-
/*[clinic end generated code: output=a8516370bf68ae08 input=aba6b1f9b30fcb8e]*/
2151+
/*[clinic end generated code: output=a8516370bf68ae08 input=866170ddeab25355]*/
21462152
{
21472153
self->ob_exports++; // this protects `self` from being cleared/resized if `iterable_of_bytes` is a custom iterator
21482154
PyObject* ret = stringlib_bytes_join((PyObject*)self, iterable_of_bytes);
@@ -2157,13 +2163,13 @@ bytearray.splitlines
21572163
21582164
Return a list of the lines in the bytearray, breaking at line boundaries.
21592165
2160-
Line breaks are not included in the resulting list unless keepends is given and
2161-
true.
2166+
Line breaks are not included in the resulting list unless keepends
2167+
is given and true.
21622168
[clinic start generated code]*/
21632169

21642170
static PyObject *
21652171
bytearray_splitlines_impl(PyByteArrayObject *self, int keepends)
2166-
/*[clinic end generated code: output=4223c94b895f6ad9 input=66b2dcdea8d093bf]*/
2172+
/*[clinic end generated code: output=4223c94b895f6ad9 input=f9fcab8a2a9b1432]*/
21672173
{
21682174
return stringlib_splitlines(
21692175
(PyObject*) self, PyByteArray_AS_STRING(self),
@@ -2181,12 +2187,13 @@ bytearray.fromhex
21812187
Create a bytearray object from a string of hexadecimal numbers.
21822188
21832189
Spaces between two numbers are accepted.
2184-
Example: bytearray.fromhex('B9 01EF') -> bytearray(b'\\xb9\\x01\\xef')
2190+
Example:
2191+
bytearray.fromhex('B9 01EF') -> bytearray(b'\\xb9\\x01\\xef')
21852192
[clinic start generated code]*/
21862193

21872194
static PyObject *
21882195
bytearray_fromhex_impl(PyTypeObject *type, PyObject *string)
2189-
/*[clinic end generated code: output=8f0f0b6d30fb3ba0 input=f033a16d1fb21f48]*/
2196+
/*[clinic end generated code: output=8f0f0b6d30fb3ba0 input=45fdeb2c74fd76fa]*/
21902197
{
21912198
PyObject *result = _PyBytes_FromHex(string, type == &PyByteArray_Type);
21922199
if (type != &PyByteArray_Type && result != NULL) {
@@ -2201,8 +2208,8 @@ bytearray.hex
22012208
sep: object = NULL
22022209
An optional single character or byte to separate hex bytes.
22032210
bytes_per_sep: int = 1
2204-
How many bytes between separators. Positive values count from the
2205-
right, negative values count from the left.
2211+
How many bytes between separators. Positive values count from
2212+
the right, negative values count from the left.
22062213
22072214
Create a string of hexadecimal numbers from a bytearray object.
22082215
@@ -2220,7 +2227,7 @@ Create a string of hexadecimal numbers from a bytearray object.
22202227

22212228
static PyObject *
22222229
bytearray_hex_impl(PyByteArrayObject *self, PyObject *sep, int bytes_per_sep)
2223-
/*[clinic end generated code: output=29c4e5ef72c565a0 input=808667e49bcccb54]*/
2230+
/*[clinic end generated code: output=29c4e5ef72c565a0 input=ad961bc88df6473a]*/
22242231
{
22252232
char* argbuf = PyByteArray_AS_STRING(self);
22262233
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
@@ -328,8 +328,8 @@ _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len)
328328
PyDoc_STRVAR_shared(_Py_title__doc__,
329329
"B.title() -> copy of B\n\
330330
\n\
331-
Return a titlecased version of B, i.e. ASCII words start with uppercase\n\
332-
characters, all remaining cased characters have lowercase.");
331+
Return a titlecased version of B, i.e. ASCII words start with\n\
332+
uppercase characters, all remaining cased characters have lowercase.");
333333

334334
void
335335
_Py_bytes_title(char *result, const char *s, Py_ssize_t len)

0 commit comments

Comments
 (0)