Skip to content

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