diff options
author | Louie Lu <me@louie.lu> | 2017-04-27 03:36:35 (GMT) |
---|---|---|
committer | Xiang Zhang <angwerzx@126.com> | 2017-04-27 03:36:35 (GMT) |
commit | 88c38b32b761cb566759b8ad96704bff590a1de9 (patch) | |
tree | 6b077e8a1ff9cd95312b26b6d3c065683c5753bd /Doc/c-api/bytes.rst | |
parent | a90b990480f45b6a0ad02d43455cf8b620bac9c5 (diff) | |
download | cpython-88c38b32b761cb566759b8ad96704bff590a1de9.zip cpython-88c38b32b761cb566759b8ad96704bff590a1de9.tar.gz cpython-88c38b32b761cb566759b8ad96704bff590a1de9.tar.bz2 |
bpo-28415: Note 0 conversion different between Python and C (#885)
Diffstat (limited to 'Doc/c-api/bytes.rst')
-rw-r--r-- | Doc/c-api/bytes.rst | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/Doc/c-api/bytes.rst b/Doc/c-api/bytes.rst index f89cfa2..5b9ebf6 100644 --- a/Doc/c-api/bytes.rst +++ b/Doc/c-api/bytes.rst @@ -72,29 +72,29 @@ called with a non-bytes parameter. | :attr:`%c` | int | A single byte, | | | | represented as a C int. | +-------------------+---------------+--------------------------------+ - | :attr:`%d` | int | Exactly equivalent to | - | | | ``printf("%d")``. | + | :attr:`%d` | int | Equivalent to | + | | | ``printf("%d")``. [1]_ | +-------------------+---------------+--------------------------------+ - | :attr:`%u` | unsigned int | Exactly equivalent to | - | | | ``printf("%u")``. | + | :attr:`%u` | unsigned int | Equivalent to | + | | | ``printf("%u")``. [1]_ | +-------------------+---------------+--------------------------------+ - | :attr:`%ld` | long | Exactly equivalent to | - | | | ``printf("%ld")``. | + | :attr:`%ld` | long | Equivalent to | + | | | ``printf("%ld")``. [1]_ | +-------------------+---------------+--------------------------------+ - | :attr:`%lu` | unsigned long | Exactly equivalent to | - | | | ``printf("%lu")``. | + | :attr:`%lu` | unsigned long | Equivalent to | + | | | ``printf("%lu")``. [1]_ | +-------------------+---------------+--------------------------------+ - | :attr:`%zd` | Py_ssize_t | Exactly equivalent to | - | | | ``printf("%zd")``. | + | :attr:`%zd` | Py_ssize_t | Equivalent to | + | | | ``printf("%zd")``. [1]_ | +-------------------+---------------+--------------------------------+ - | :attr:`%zu` | size_t | Exactly equivalent to | - | | | ``printf("%zu")``. | + | :attr:`%zu` | size_t | Equivalent to | + | | | ``printf("%zu")``. [1]_ | +-------------------+---------------+--------------------------------+ - | :attr:`%i` | int | Exactly equivalent to | - | | | ``printf("%i")``. | + | :attr:`%i` | int | Equivalent to | + | | | ``printf("%i")``. [1]_ | +-------------------+---------------+--------------------------------+ - | :attr:`%x` | int | Exactly equivalent to | - | | | ``printf("%x")``. | + | :attr:`%x` | int | Equivalent to | + | | | ``printf("%x")``. [1]_ | +-------------------+---------------+--------------------------------+ | :attr:`%s` | const char\* | A null-terminated C character | | | | array. | @@ -111,6 +111,9 @@ called with a non-bytes parameter. An unrecognized format character causes all the rest of the format string to be copied as-is to the result object, and any extra arguments discarded. + .. [1] For integer specifiers (d, u, ld, lu, zd, zu, i, x): the 0-conversion + flag has effect even when a precision is given. + .. c:function:: PyObject* PyBytes_FromFormatV(const char *format, va_list vargs) |