Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Doc/c-api/arg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
Comment on lines +689 to +693
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to put this inside a .. note:: directive, like the .. note:: This format does not accept bytes-like objects above?

Suggested change
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``.
.. note::
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``.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't mind, but, I don't think this needs to be called out so prominently. An extra paragraph is already pretty noticeable.


.. versionadded:: 3.14

``c`` (:class:`bytes` of length 1) [char]
Expand Down
Loading