mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
Show '\011', '\012', and '\015' as '\t', '\n', '\r' in strings.
Switch from octal escapes to hex escapes for other nonprintable characters.
This commit is contained in:
parent
726b78ecb8
commit
fa004ad36c
13 changed files with 221 additions and 205 deletions
|
|
@ -168,8 +168,8 @@ big-endian machine):
|
|||
\begin{verbatim}
|
||||
>>> from struct import *
|
||||
>>> pack('hhl', 1, 2, 3)
|
||||
'\000\001\000\002\000\000\000\003'
|
||||
>>> unpack('hhl', '\000\001\000\002\000\000\000\003')
|
||||
'\x00\x01\x00\x02\x00\x00\x00\x03'
|
||||
>>> unpack('hhl', '\x00\x01\x00\x02\x00\x00\x00\x03')
|
||||
(1, 2, 3)
|
||||
>>> calcsize('hhl')
|
||||
8
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue