mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
merge from 3.2.
This commit is contained in:
parent
877f2e4530
commit
a09f13a0bc
1 changed files with 5 additions and 4 deletions
|
@ -257,10 +257,11 @@ not contain whitespace though.
|
||||||
For the ``'s'`` format character, the count is interpreted as the size of the
|
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,
|
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.
|
``'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
|
If a count is not given, it defaults to 1. For packing, the string is
|
||||||
make it fit. For unpacking, the resulting string always has exactly the
|
truncated or padded with null bytes as appropriate to make it fit. For
|
||||||
specified number of bytes. As a special case, ``'0s'`` means a single, empty
|
unpacking, the resulting string always has exactly the specified number of
|
||||||
string (while ``'0c'`` means 0 characters).
|
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
|
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.
|
variable-length string stored in a *fixed number of bytes*, given by the count.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue