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

Skip to content

Commit d80a8ee

Browse files
committed
Remove accidental (yet-to-be-reviewed) docstring changes included in r81947.
1 parent 4b80ef5 commit d80a8ee

1 file changed

Lines changed: 21 additions & 28 deletions

File tree

Modules/_struct.c

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,8 +1398,9 @@ s_unpack_internal(PyStructObject *soself, char *startfrom) {
13981398
PyDoc_STRVAR(s_unpack__doc__,
13991399
"S.unpack(buffer) -> (v1, v2, ...)\n\
14001400
\n\
1401-
Return a tuple containing values unpacked according to S.format. Requires\n\
1402-
len(buffer) == S.size. See help(struct) for more on format strings.");
1401+
Return tuple containing values unpacked according to this Struct's format.\n\
1402+
Requires len(buffer) == self.size. See struct.__doc__ for more on format\n\
1403+
strings.");
14031404

14041405
static PyObject *
14051406
s_unpack(PyObject *self, PyObject *input)
@@ -1425,10 +1426,12 @@ s_unpack(PyObject *self, PyObject *input)
14251426
}
14261427

14271428
PyDoc_STRVAR(s_unpack_from__doc__,
1428-
"S.unpack_from(buffer[, offset=0]) -> (v1, v2, ...)\n\
1429+
"S.unpack_from(buffer[, offset]) -> (v1, v2, ...)\n\
14291430
\n\
1430-
Return a tuple containing values unpacked according to S.format. Requires\n\
1431-
len(buffer[offset:]) >= S.size. See help(struct) for more on format strings.");
1431+
Return tuple containing values unpacked according to this Struct's format.\n\
1432+
Unlike unpack, unpack_from can unpack values from any object supporting\n\
1433+
the buffer API, not just str. Requires len(buffer[offset:]) >= self.size.\n\
1434+
See struct.__doc__ for more on format strings.");
14321435

14331436
static PyObject *
14341437
s_unpack_from(PyObject *self, PyObject *args, PyObject *kwds)
@@ -1563,8 +1566,8 @@ s_pack_internal(PyStructObject *soself, PyObject *args, int offset, char* buf)
15631566
PyDoc_STRVAR(s_pack__doc__,
15641567
"S.pack(v1, v2, ...) -> bytes\n\
15651568
\n\
1566-
Return a bytes object containing values v1, v2, ... packed according to\n\
1567-
S.format. See help(struct) for more on format strings.");
1569+
Return a bytes containing values v1, v2, ... packed according to this\n\
1570+
Struct's format. See struct.__doc__ for more on format strings.");
15681571

15691572
static PyObject *
15701573
s_pack(PyObject *self, PyObject *args)
@@ -1600,9 +1603,10 @@ s_pack(PyObject *self, PyObject *args)
16001603
PyDoc_STRVAR(s_pack_into__doc__,
16011604
"S.pack_into(buffer, offset, v1, v2, ...)\n\
16021605
\n\
1603-
Pack the values v1, v2, ... according to S.format and write the packed bytes\n\
1604-
into the writable buffer buf starting at offset. Note that the offset is not\n\
1605-
an optional argument. See help(struct) for more on format strings.");
1606+
Pack the values v1, v2, ... according to this Struct's format, write \n\
1607+
the packed bytes into the writable buffer buf starting at offset. Note\n\
1608+
that the offset is not an optional argument. See struct.__doc__ for \n\
1609+
more on format strings.");
16061610

16071611
static PyObject *
16081612
s_pack_into(PyObject *self, PyObject *args)
@@ -1792,10 +1796,7 @@ calcsize(PyObject *self, PyObject *fmt)
17921796
}
17931797

17941798
PyDoc_STRVAR(pack_doc,
1795-
"pack(fmt, v1, v2, ...) -> bytes\n\
1796-
\n\
1797-
Return a bytes object containing values v1, v2, ... packed according to fmt.\n\
1798-
See help(struct) for more on format strings.");
1799+
"Return bytes containing values v1, v2, ... packed according to fmt.");
17991800

18001801
static PyObject *
18011802
pack(PyObject *self, PyObject *args)
@@ -1824,11 +1825,8 @@ pack(PyObject *self, PyObject *args)
18241825
}
18251826

18261827
PyDoc_STRVAR(pack_into_doc,
1827-
"pack_into(fmt, buffer, offset, v1, v2, ...)\n\
1828-
\n\
1829-
Pack the values v1, v2, ... according to fmt and write the packed bytes into\n\
1830-
the writable buffer buf starting at offset. Note that the offset is not an\n\
1831-
optional argument. See help(struct) for more on format strings.");
1828+
"Pack the values v1, v2, ... according to fmt.\n\
1829+
Write the packed bytes into the writable buffer buf starting at offset.");
18321830

18331831
static PyObject *
18341832
pack_into(PyObject *self, PyObject *args)
@@ -1857,10 +1855,8 @@ pack_into(PyObject *self, PyObject *args)
18571855
}
18581856

18591857
PyDoc_STRVAR(unpack_doc,
1860-
"unpack(fmt, buffer) -> (v1, v2, ...)\n\
1861-
\n\
1862-
Return a tuple containing values unpacked according to fmt. Requires\n\
1863-
len(buffer) == calcsize(fmt). See help(struct) for more on format strings.");
1858+
"Unpack the bytes containing packed C structure data, according to fmt.\n\
1859+
Requires len(bytes) == calcsize(fmt).");
18641860

18651861
static PyObject *
18661862
unpack(PyObject *self, PyObject *args)
@@ -1879,11 +1875,8 @@ unpack(PyObject *self, PyObject *args)
18791875
}
18801876

18811877
PyDoc_STRVAR(unpack_from_doc,
1882-
"unpack_from(fmt, buffer[, offset=0]) -> (v1, v2, ...)\n\
1883-
\n\
1884-
Return a tuple containing values unpacked according to fmt. Requires\n\
1885-
len(buffer[offset:]) >= calcsize(fmt). See help(struct) for more on format\n\
1886-
strings.");
1878+
"Unpack the buffer, containing packed C structure data, according to\n\
1879+
fmt, starting at offset. Requires len(buffer[offset:]) >= calcsize(fmt).");
18871880

18881881
static PyObject *
18891882
unpack_from(PyObject *self, PyObject *args, PyObject *kwds)

0 commit comments

Comments
 (0)