8000 gh-50333: Deprecate support of non-tuple sequences in PyArg_ParseTuple() by serhiy-storchaka · Pull Request #128374 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-50333: Deprecate support of non-tuple sequences in PyArg_ParseTuple() #128374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Prev Previous commit
Next Next commit
Update docs.
  • Loading branch information
serhiy-storchaka committed Jan 3, 2025
commit 44fd7000294b45fc575ba2250aac64e2383b7f9f
8 changes: 6 additions & 2 deletions Doc/c-api/arg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,9 @@ Other objects

.. versionadded:: 3.3

``(items)`` (:class:`tuple`) [*matching-items*]
The object must be a Python sequence whose length is the number of format units
``(items)`` (sequence) [*matching-items*]
The object must be a Python sequence (except :class:`str`, :class:`bytes`
or :class:`bytearray`) whose length is the number of format units
in *items*. The C arguments must correspond to the individual format units in
*items*. Format units for sequences may be nested.

Expand All @@ -351,6 +352,9 @@ Other objects
The *converter* for the ``O&`` format unit in *items* must not store
a borrowed buffer or a borrowed reference.

.. versionchanged:: next
:class:`str` and :class:`bytearray` objects no longer accepted as a sequence.

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