8000 gh-132629: Deprecate acception out of range values for unsigned integers in PyArg_Parse by serhiy-storchaka · Pull Request #132630 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-132629: Deprecate acception out of range values for unsigned integers in PyArg_Parse #132630

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
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update documentation.
  • Loading branch information
serhiy-storchaka committed May 23, 2025
commit f51a0528b0d425b54e8011d5380c8a3079acfcab
8 changes: 4 additions & 4 deletions Doc/c-api/arg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ is out of range for the C type.
For unsigned integer formats, the
most significant bits are silently truncated when the receiving field is too
small to receive the value, and :exc:`DeprecationWarning` is emitted when
the value is larger than the maximal value for the corresponding C type or less than the
minimal value for the corresponding signed integer type.
the value is larger than the maximal value for the C type or less than
the minimal value for the corresponding signed integer type of the same size.

``b`` (:class:`int`) [unsigned char]
Convert a nonnegative Python integer to an unsigned tiny integer, stored in a C
Expand Down Expand Up @@ -313,8 +313,8 @@ minimal value for the corresponding signed integer type.

For unsigned integer formats ``B``, ``H``, ``I``, ``k`` and ``K``,
:exc:`DeprecationWarning` is emitted when the value is larger than
the maximal value for the corresponding C type or less than the minimal value for
the corresponding signed integer type.
the maximal value for the C type or less than the minimal value for
the corresponding signed integer type of the same size.


Other objects
Expand Down
7 changes: 3 additions & 4 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,9 @@ Deprecated C APIs
-----------------

* For unsigned integer formats in :c:func:`PyArg_ParseTuple`,
accepting Python integers with value that is larger than
the maximal value the corresponding C type or less than
the minimal value for the corresponding signed integer type
is now deprecated.
accepting Python integers with value that is larger than the maximal value
for the C type or less than the minimal value for the corresponding
signed integer type of the same size is now deprecated.
(Contributed by Serhiy Storchaka in :gh:`132629`.)

.. Add C API deprecations above alphabetically, not here at the end.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
For unsigned integer formats in :c:func:`PyArg_ParseTuple`, accepting Python
integers with value that is larger than the maximal value for the corresponding
C type or less than the minimal value for the corresponding signed integer
type is now deprecated.
integers with value that is larger than the maximal value for the C type or
less than the minimal value for the corresponding signed integer type
of the same size is now deprecated.
Loading
0