]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
merge from 3.2.
authorSenthil Kumaran <senthil@uthcode.com>
Sun, 17 Jul 2011 09:31:51 +0000 (17:31 +0800)
committerSenthil Kumaran <senthil@uthcode.com>
Sun, 17 Jul 2011 09:31:51 +0000 (17:31 +0800)
Doc/library/struct.rst

index 18f6a83b6b703c05ac2483330bd27cf4334d287e..9c7fdd813876b438397095c59cede0611cd345b3 100644 (file)
@@ -257,10 +257,11 @@ not contain whitespace though.
 For the ``'s'`` format character, the count is interpreted as the size of the
 string, 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 string 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 string always has exactly the specified number of
+bytes.  As a special case, ``'0s'`` means a single, empty string (while
+``'0c'`` means 0 characters).
 
 The ``'p'`` format character encodes a "Pascal string", meaning a short
 variable-length string stored in a *fixed number of bytes*, given by the count.