Skip to content

Conversation

@vstinner
Copy link
Member

@vstinnervstinner 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
MemberAuthor

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.

@vstinnervstinner merged commit 307b9d0 into python:masterApr 8, 2020
@vstinnervstinner deleted the remove_index_check_macro branch April 8, 2020 00:26
Sign up for freeto 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

@vstinner@the-knights-who-say-ni@bedevere-bot