Skip to content

bpo-40170: Remove PyIndex_Check() macro #19428

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 1 commit into from
Apr 8, 2020
Merged

bpo-40170: Remove PyIndex_Check() macro #19428

merged 1 commit into from
Apr 8, 2020

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Apr 8, 2020

Always declare PyIndex_Check() as an opaque function to hide
implementation details: remove PyIndex_Check() macro. The macro
accessed directly the PyTypeObject.tp_as_number member.

https://bugs.python.org/issue40170

Always declare PyIndex_Check() as an opaque function to hide
implementation details: remove PyIndex_Check() macro. The macro
accessed directly the PyTypeObject.tp_as_number member.
@vstinner
Copy link
Member Author

vstinner commented Apr 8, 2020

I already modified C files of Python and Objects subdirectories to use a new fast inlined _PyIndex_Check() function in commit a15e260 (GH-19426).

Only the following modules will be impacted by this change:

  • Modules/_ctypes/_ctypes.c
  • Modules/_elementtree.c
  • Modules/_functoolsmodule.c
  • Modules/_sre.c
  • Modules/_struct.c
  • Modules/_testbuffer.c
  • Modules/_xxsubinterpretersmodule.c
  • Modules/arraymodule.c
  • Modules/mmapmodule.c
  • Modules/posixmodule.c

These modules will now call a function rather than inlining the code.

@vstinner vstinner merged commit 307b9d0 into python:master Apr 8, 2020
@vstinner vstinner deleted the remove_index_check_macro branch April 8, 2020 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants