diff options
| author | Senthil Kumaran <senthil@uthcode.com> | 2011-07-17 17:32:06 +0800 |
|---|---|---|
| committer | Senthil Kumaran <senthil@uthcode.com> | 2011-07-17 17:32:06 +0800 |
| commit | 87e59cd701fd4a3dc04dbbcc6cf4d4c9086c0495 (patch) | |
| tree | c41245ee90a4338703ffefb5cfd76c4ca31446f4 | |
| parent | 8232d6efcfc611fa9f565a27073419ddaf48148a (diff) | |
| parent | ad3882a2b0c178eaa220eb07f768aecff78ec468 (diff) | |
| download | cpython-git-87e59cd701fd4a3dc04dbbcc6cf4d4c9086c0495.tar.gz | |
merge from 3.2
| -rw-r--r-- | Doc/library/struct.rst | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst index 42bfc14d96..12820e0282 100644 --- a/Doc/library/struct.rst +++ b/Doc/library/struct.rst @@ -240,10 +240,11 @@ not contain whitespace though. For the ``'s'`` format character, the count is interpreted as the length of the bytes, not a repeat count like for the other format characters; for example, ``'10s'`` means a single 10-byte string, while ``'10c'`` means 10 characters. -For packing, the string is truncated or padded with null bytes as appropriate to -make it fit. For unpacking, the resulting bytes object always has exactly the -specified number of bytes. As a special case, ``'0s'`` means a single, empty -string (while ``'0c'`` means 0 characters). +If a count is not given, it defaults to 1. For packing, the string is +truncated or padded with null bytes as appropriate to make it fit. For +unpacking, the resulting bytes object always has exactly the specified number +of bytes. As a special case, ``'0s'`` means a single, empty string (while +``'0c'`` means 0 characters). When packing a value ``x`` using one of the integer formats (``'b'``, ``'B'``, ``'h'``, ``'H'``, ``'i'``, ``'I'``, ``'l'``, ``'L'``, |
