@@ -2156,14 +2156,14 @@ Return a tuple containing unpacked values.
21562156
21572157Values are unpacked according to the struct format string. The
21582158buffer's size in bytes, starting at position offset, must be at
2159- least the struct size. See help(struct) for more on format
2160- strings.
2159+ least the struct size. A negative offset counts from the end of
2160+ the buffer. See help(struct) for more on format strings.
21612161[clinic start generated code]*/
21622162
21632163static PyObject *
21642164Struct_unpack_from_impl (PyStructObject * self , Py_buffer * buffer ,
21652165 Py_ssize_t offset )
2166- /*[clinic end generated code: output=57fac875e0977316 input=57cfcf84c088faa4 ]*/
2166+ /*[clinic end generated code: output=57fac875e0977316 input=49b7c90dd8faeb97 ]*/
21672167{
21682168 _structmodulestate * state = get_struct_state_structinst (self );
21692169 ENSURE_STRUCT_IS_READY (self );
@@ -2497,15 +2497,16 @@ Pack values and write the packed bytes into the buffer.
24972497
24982498Pack the provided values according to the struct format string
24992499and write the packed bytes into the writable buffer starting at
2500- offset. Note that the offset is a required argument. See
2501- help(struct) for more on format strings.
2500+ offset. Note that the offset is a required argument. A negative
2501+ offset counts from the end of the buffer. See help(struct) for
2502+ more on format strings.
25022503[clinic start generated code]*/
25032504
25042505static PyObject *
25052506Struct_pack_into_impl (PyStructObject * self , Py_buffer * buffer ,
25062507 Py_ssize_t offset , PyObject * const * values ,
25072508 Py_ssize_t values_length )
2508- /*[clinic end generated code: output=aa9d9a93f5f8f77b input=9d842a368ee14245 ]*/
2509+ /*[clinic end generated code: output=aa9d9a93f5f8f77b input=a2b8749e3843f01b ]*/
25092510{
25102511 _structmodulestate * state = get_struct_state_structinst (self );
25112512
@@ -2735,15 +2736,15 @@ Pack values and write the packed bytes into the buffer.
27352736
27362737Pack the provided values according to the format string and write the
27372738packed bytes into the writable buffer starting at offset. Note that the
2738- offset is a required argument. See help(struct) for more on format
2739- strings.
2739+ offset is a required argument. A negative offset counts from the end of
2740+ the buffer. See help(struct) for more on format strings.
27402741[clinic start generated code]*/
27412742
27422743static PyObject *
27432744pack_into_impl (PyObject * module , PyStructObject * s_object , Py_buffer * buffer ,
27442745 Py_ssize_t offset , PyObject * const * values ,
27452746 Py_ssize_t values_length )
2746- /*[clinic end generated code: output=e8bf7d422b2088ef input=086867c0f5d8a8e4 ]*/
2747+ /*[clinic end generated code: output=e8bf7d422b2088ef input=548c35c57db7436a ]*/
27472748{
27482749 return Struct_pack_into_impl (s_object , buffer , offset ,
27492750 values , values_length );
@@ -2781,14 +2782,15 @@ unpack_from
27812782
27822783Return a tuple containing values unpacked according to the format string.
27832784
2784- The buffer's size, minus offset, must be at least calcsize(format). See
2785+ The buffer must contain at least calcsize(format) bytes starting at
2786+ offset. A negative offset counts from the end of the buffer. See
27852787help(struct) for more on format strings.
27862788[clinic start generated code]*/
27872789
27882790static PyObject *
27892791unpack_from_impl (PyObject * module , PyStructObject * s_object ,
27902792 Py_buffer * buffer , Py_ssize_t offset )
2791- /*[clinic end generated code: output=1042631674c6e0d3 input=3e46619756fb0293 ]*/
2793+ /*[clinic end generated code: output=1042631674c6e0d3 input=fb755400a7a47a51 ]*/
27922794{
27932795 return Struct_unpack_from_impl (s_object , buffer , offset );
27942796}
0 commit comments