@@ -1398,9 +1398,8 @@ s_unpack_internal(PyStructObject *soself, char *startfrom) {
13981398PyDoc_STRVAR (s_unpack__doc__ ,
13991399"S.unpack(buffer) -> (v1, v2, ...)\n\
14001400\n\
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." );
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." );
14041403
14051404static PyObject *
14061405s_unpack (PyObject * self , PyObject * input )
@@ -1426,12 +1425,10 @@ s_unpack(PyObject *self, PyObject *input)
14261425}
14271426
14281427PyDoc_STRVAR (s_unpack_from__doc__ ,
1429- "S.unpack_from(buffer[, offset]) -> (v1, v2, ...)\n\
1428+ "S.unpack_from(buffer[, offset=0 ]) -> (v1, v2, ...)\n\
14301429\n\
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." );
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." );
14351432
14361433static PyObject *
14371434s_unpack_from (PyObject * self , PyObject * args , PyObject * kwds )
@@ -1566,8 +1563,8 @@ s_pack_internal(PyStructObject *soself, PyObject *args, int offset, char* buf)
15661563PyDoc_STRVAR (s_pack__doc__ ,
15671564"S.pack(v1, v2, ...) -> bytes\n\
15681565\n\
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." );
1566+ Return a bytes object containing values v1, v2, ... packed according to\n\
1567+ S. format. See help( struct) for more on format strings." );
15711568
15721569static PyObject *
15731570s_pack (PyObject * self , PyObject * args )
@@ -1603,10 +1600,9 @@ s_pack(PyObject *self, PyObject *args)
16031600PyDoc_STRVAR (s_pack_into__doc__ ,
16041601"S.pack_into(buffer, offset, v1, v2, ...)\n\
16051602\n\
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." );
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." );
16101606
16111607static PyObject *
16121608s_pack_into (PyObject * self , PyObject * args )
@@ -1796,7 +1792,10 @@ calcsize(PyObject *self, PyObject *fmt)
17961792}
17971793
17981794PyDoc_STRVAR (pack_doc ,
1799- "Return bytes containing values v1, v2, ... packed according to fmt." );
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." );
18001799
18011800static PyObject *
18021801pack (PyObject * self , PyObject * args )
@@ -1825,8 +1824,11 @@ pack(PyObject *self, PyObject *args)
18251824}
18261825
18271826PyDoc_STRVAR (pack_into_doc ,
1828- "Pack the values v1, v2, ... according to fmt.\n\
1829- Write the packed bytes into the writable buffer buf starting at offset." );
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." );
18301832
18311833static PyObject *
18321834pack_into (PyObject * self , PyObject * args )
@@ -1855,8 +1857,10 @@ pack_into(PyObject *self, PyObject *args)
18551857}
18561858
18571859PyDoc_STRVAR (unpack_doc ,
1858- "Unpack the bytes containing packed C structure data, according to fmt.\n\
1859- Requires len(bytes) == calcsize(fmt)." );
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." );
18601864
18611865static PyObject *
18621866unpack (PyObject * self , PyObject * args )
@@ -1875,8 +1879,11 @@ unpack(PyObject *self, PyObject *args)
18751879}
18761880
18771881PyDoc_STRVAR (unpack_from_doc ,
1878- "Unpack the buffer, containing packed C structure data, according to\n\
1879- fmt, starting at offset. Requires len(buffer[offset:]) >= calcsize(fmt)." );
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." );
18801887
18811888static PyObject *
18821889unpack_from (PyObject * self , PyObject * args , PyObject * kwds )
0 commit comments