mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] gh-89488: Add warning about Py_BuildValue("p") needing exact int (GH-135610) (GH-135843)
(cherry picked from commit 6aa0826ed7)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
parent
a843fece61
commit
f0a330e5fb
1 changed files with 6 additions and 0 deletions
|
|
@ -686,6 +686,12 @@ Building values
|
|||
``p`` (:class:`bool`) [int]
|
||||
Convert a C :c:expr:`int` to a Python :class:`bool` object.
|
||||
|
||||
Be aware that this format requires an ``int`` argument.
|
||||
Unlike most other contexts in C, variadic arguments are not coerced to
|
||||
a suitable type automatically.
|
||||
You can convert another type (for example, a pointer or a float) to a
|
||||
suitable ``int`` value using ``(x) ? 1 : 0`` or ``!!x``.
|
||||
|
||||
.. versionadded:: 3.14
|
||||
|
||||
``c`` (:class:`bytes` of length 1) [char]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue