This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact() in 2.7
Type: Stage: resolved
Components: Interpreter Core Versions: Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, corona10, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2018-07-26 11:28 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

File name Uploaded Description Edit
anyint.cocci serhiy.storchaka, 2018-07-26 11:32
Pull Requests
URL Status Linked Edit
PR 8479 merged serhiy.storchaka, 2018-07-26 11:29
Messages (3)
msg322415 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-07-26 11:28
The proposed PR adds two private helpers

#define _PyAnyInt_Check(op) (PyInt_Check(op) || PyLong_Check(op))
#define _PyAnyInt_CheckExact(op) (PyInt_CheckExact(op) || PyLong_CheckExact(op))

and make it used it in the code. This may help to avoid bugs like issue34229.
msg322417 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-07-26 11:32
Most changes are made automatically by the Coccinelle ( script.

    spatch --sp-file anyint.cocci --dir . --in-place
msg322726 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-07-31 06:09
New changeset 48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202 by Serhiy Storchaka in branch '2.7':
[2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479)
Date User Action Args
2022-04-11 14:59:03adminsetgithub: 78415
2021-08-23 01:42:46corona10setpull_requests: - pull_request26358
2021-08-23 01:37:29corona10setnosy: + corona10

pull_requests: + pull_request26358
2018-07-31 06:09:54serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-07-31 06:09:39serhiy.storchakasetmessages: + msg322726
2018-07-26 11:32:58serhiy.storchakasetfiles: + anyint.cocci

messages: + msg322417
2018-07-26 11:29:44serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request8002
2018-07-26 11:28:00serhiy.storchakacreate