Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
  • Loading branch information
3 people authored Jan 2, 2025
1 parent 6ad1ff6 commit 9878b37
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Doc/c-api/arg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,17 @@ Other objects
in *items*. The C arguments must correspond to the individual format units in
*items*. Format units for sequences may be nested.

If *items* contains format units which store
If *items* contains format units which store a
:ref:`borrowed buffer <c-arg-borrowed-buffer>` or
:term:`reference <borrowed reference>`
a :term:`borrowed reference`
(``y``, ``y#``, ``s``, ``s#``, ``z``, ``z#``, ``S``, ``Y``, ``U``,
``O`` or ``O!``) the object must be a Python tuple.
``O`` or ``O!``), the object must be a Python tuple.
The *converter* for the ``O&`` format unit in *items* must not store
borrowed buffer or reference.
a borrowed buffer or reference.

.. deprecated:: next
Non-tuple sequences are deprecated if *items* contains format units
which store borrowed buffer or reference.
which store a borrowed buffer or reference.

It is possible to pass "long" integers (integers whose value exceeds the
platform's :c:macro:`LONG_MAX`) however no proper range checking is done --- the
Expand Down
4 changes: 2 additions & 2 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1230,8 +1230,8 @@ Deprecated
* Non-tuple sequences are deprecated as argument for the ``(items)``
format unit in :c:func:`PyArg_ParseTuple` and other
:ref:`argument parsing <arg-parsing>` functions if *items* contains
format units which store :ref:`borrowed buffer <c-arg-borrowed-buffer>` or
:term:`reference <borrowed reference>`.
format units which store a :ref:`borrowed buffer <c-arg-borrowed-buffer>`
or a :term:`borrowed reference`.
(Contributed by Serhiy Storchaka in :gh:`50333`.)

* The previously undocumented function :c:func:`PySequence_In` is :term:`soft deprecated`.
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_capi/test_getargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def test_tuple(self):
ret = getargs_tuple(1, (2, 3))
self.assertEqual(ret, (1,2,3))

# make sure invalid tuple arguments are handled correctly
# make sure invalid sequence arguments are handled correctly
class TestSeq:
def __len__(self):
return 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Non-tuple sequences are deprecated as argument for the ``(items)`` format
unit in :c:func:`PyArg_ParseTuple` and other :ref:`argument parsing
<arg-parsing>` functions if *items* contains format units which store
:ref:`borrowed buffer <c-arg-borrowed-buffer>` or :term:`reference <borrowed
reference>`.
a :ref:`borrowed buffer <c-arg-borrowed-buffer>` or a :term:`borrowed
reference`.

0 comments on commit 9878b37

Please sign in to comment.