@@ -2127,14 +2127,14 @@ Return a tuple containing unpacked values.
21272127
21282128Values are unpacked according to the struct format string. The
21292129buffer's size in bytes, starting at position offset, must be at
2130- least the struct size. See help(struct) for more on format
2131- strings.
2130+ least the struct size. A negative offset counts from the end of
2131+ the buffer. See help(struct) for more on format strings.
21322132[clinic start generated code]*/
21332133
21342134static PyObject *
21352135Struct_unpack_from_impl (PyStructObject * self , Py_buffer * buffer ,
21362136 Py_ssize_t offset )
2137- /*[clinic end generated code: output=57fac875e0977316 input=57cfcf84c088faa4 ]*/
2137+ /*[clinic end generated code: output=57fac875e0977316 input=49b7c90dd8faeb97 ]*/
21382138{
21392139 _structmodulestate * state = get_struct_state_structinst (self );
21402140 ENSURE_STRUCT_IS_READY (self );
@@ -2468,15 +2468,16 @@ Pack values and write the packed bytes into the buffer.
24682468
24692469Pack the provided values according to the struct format string
24702470and write the packed bytes into the writable buffer starting at
2471- offset. Note that the offset is a required argument. See
2472- help(struct) for more on format strings.
2471+ offset. Note that the offset is a required argument. A negative
2472+ offset counts from the end of the buffer. See help(struct) for
2473+ more on format strings.
24732474[clinic start generated code]*/
24742475
24752476static PyObject *
24762477Struct_pack_into_impl (PyStructObject * self , Py_buffer * buffer ,
24772478 Py_ssize_t offset , PyObject * const * values ,
24782479 Py_ssize_t values_length )
2479- /*[clinic end generated code: output=aa9d9a93f5f8f77b input=9d842a368ee14245 ]*/
2480+ /*[clinic end generated code: output=aa9d9a93f5f8f77b input=a2b8749e3843f01b ]*/
24802481{
24812482 _structmodulestate * state = get_struct_state_structinst (self );
24822483
@@ -2706,15 +2707,15 @@ Pack values and write the packed bytes into the buffer.
27062707
27072708Pack the provided values according to the format string and write the
27082709packed bytes into the writable buffer starting at offset. Note that the
2709- offset is a required argument. See help(struct) for more on format
2710- strings.
2710+ offset is a required argument. A negative offset counts from the end of
2711+ the buffer. See help(struct) for more on format strings.
27112712[clinic start generated code]*/
27122713
27132714static PyObject *
27142715pack_into_impl (PyObject * module , PyStructObject * s_object , Py_buffer * buffer ,
27152716 Py_ssize_t offset , PyObject * const * values ,
27162717 Py_ssize_t values_length )
2717- /*[clinic end generated code: output=e8bf7d422b2088ef input=086867c0f5d8a8e4 ]*/
2718+ /*[clinic end generated code: output=e8bf7d422b2088ef input=548c35c57db7436a ]*/
27182719{
27192720 return Struct_pack_into_impl (s_object , buffer , offset ,
27202721 values , values_length );
@@ -2752,14 +2753,15 @@ unpack_from
27522753
27532754Return a tuple containing values unpacked according to the format string.
27542755
2755- The buffer's size, minus offset, must be at least calcsize(format). See
2756+ The buffer must contain at least calcsize(format) bytes starting at
2757+ offset. A negative offset counts from the end of the buffer. See
27562758help(struct) for more on format strings.
27572759[clinic start generated code]*/
27582760
27592761static PyObject *
27602762unpack_from_impl (PyObject * module , PyStructObject * s_object ,
27612763 Py_buffer * buffer , Py_ssize_t offset )
2762- /*[clinic end generated code: output=1042631674c6e0d3 input=3e46619756fb0293 ]*/
2764+ /*[clinic end generated code: output=1042631674c6e0d3 input=fb755400a7a47a51 ]*/
27632765{
27642766 return Struct_unpack_from_impl (s_object , buffer , offset );
27652767}
0 commit comments