@@ -38,38 +38,38 @@ The module defines the following exception and functions:
3838
3939.. function :: pack(fmt, v1, v2, ...)
4040
41- Return a bytes containing the values `` v1, v2 , ...`` packed according to the
42- given format. The arguments must match the values required by the format
43- exactly.
41+ Return a bytes object containing the values * v1 *, * v2 * , ... packed according
42+ to the format string * fmt * . The arguments must match the values required by
43+ the format exactly.
4444
4545
4646.. function :: pack_into(fmt, buffer, offset, v1, v2, ...)
4747
48- Pack the values `` v1, v2 , ...`` according to the given format, write the
49- packed bytes into the writable *buffer * starting at * offset *. Note that the
50- offset is a required argument.
48+ Pack the values * v1 *, * v2 * , ... according to the format string * fmt * and
49+ write the packed bytes into the writable buffer *buffer * starting at
50+ position * offset *. Note that * offset * is a required argument.
5151
5252
53- .. function :: unpack(fmt, bytes )
53+ .. function :: unpack(fmt, buffer )
5454
55- Unpack the bytes (presumably packed by ``pack(fmt, ...) ``) according to the
56- given format. The result is a tuple even if it contains exactly one item.
57- The bytes must contain exactly the amount of data required by the format
58- (``len(bytes) `` must equal ``calcsize(fmt) ``).
55+ Unpack from the buffer * buffer * (presumably packed by ``pack(fmt, ...) ``)
56+ according to the format string * fmt * . The result is a tuple even if it
57+ contains exactly one item. The buffer must contain exactly the amount of
58+ data required by the format (``len(bytes) `` must equal ``calcsize(fmt) ``).
5959
6060
6161.. function :: unpack_from(fmt, buffer, offset=0)
6262
63- Unpack the *buffer * according to the given format. The result is a tuple even
64- if it contains exactly one item. The * buffer * must contain at least the
65- amount of data required by the format (`` len(buffer[offset:]) `` must be at
66- least ``calcsize(fmt) ``).
63+ Unpack from *buffer * starting at position * offset *, according to the format
64+ string * fmt *. The result is a tuple even if it contains exactly one
65+ item. * buffer * must contain at least the amount of data required by the
66+ format (`` len(buffer[offset:]) `` must be at least ``calcsize(fmt) ``).
6767
6868
6969.. function :: calcsize(fmt)
7070
71- Return the size of the struct (and hence of the bytes) corresponding to the
72- given format.
71+ Return the size of the struct (and hence of the bytes object produced by
72+ `` pack(fmt, ...) ``) corresponding to the format string * fmt * .
7373
7474.. _struct-format-strings :
7575
@@ -358,10 +358,10 @@ The :mod:`struct` module also defines the following type:
358358 Identical to the :func: `pack_into ` function, using the compiled format.
359359
360360
361- .. method :: unpack(bytes )
361+ .. method :: unpack(buffer )
362362
363363 Identical to the :func: `unpack ` function, using the compiled format.
364- (``len(bytes ) `` must equal :attr: `self.size `).
364+ (``len(buffer ) `` must equal :attr: `self.size `).
365365
366366
367367 .. method :: unpack_from(buffer, offset=0)
@@ -376,6 +376,6 @@ The :mod:`struct` module also defines the following type:
376376
377377 .. attribute :: size
378378
379- The calculated size of the struct (and hence of the bytes) corresponding
380- to :attr: `format `.
379+ The calculated size of the struct (and hence of the bytes object produced
380+ by the :meth: ` pack ` method) corresponding to :attr: `format `.
381381
0 commit comments