Skip to content

gh-94673: Add _PyStaticType_InitBuiltin() #95152

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Jul 22, 2022

This is the first of several precursors to storing tp_subclasses (and tp_weaklist) on the interpreter state for static builtin types.

We do the following:

  • add _PyStaticType_InitBuiltin()
  • add _Py_TPFLAGS_STATIC_BUILTIN
  • set it on all static builtin types in _PyStaticType_InitBuiltin()
  • shuffle some code around to be able to use _PyStaticType_InitBuiltin()
    • rename _PyStructSequence_InitType() to _PyStructSequence_InitBuiltinWithFlags()
    • add _PyStructSequence_InitBuiltin().

@ericsnowcurrently
Copy link
Member Author

This was split out of #94995.

@ericsnowcurrently ericsnowcurrently merged commit 4a1dd73 into python:main Jul 25, 2022
@ericsnowcurrently ericsnowcurrently deleted the init-static-builtin-new branch July 25, 2022 18:47
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants