Skip to content
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

GH-115776: Rename Py_TPFLAGS_INLINE_VALUES as _Py_TPFLAGS_INLINE_VALUES #128635

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Jan 8, 2025

The Py_TPFLAGS_INLINE_VALUES should not be used when declaring a static PyTypeObject. It can only be used by the VM when creating a class. It is undocumented, but is exposed in object.h.
This PR adds an underscore prefix to the name to make it clearer that this flag is internal.

@Fidget-Spinner
Copy link
Member

There are 2 package using this, but otherwise LGTM https://grep.app/search?q=Py_TPFLAGS_INLINE_VALUES

@markshannon
Copy link
Member Author

That's unfortunate. I still think we are better off moving it, as any code using it (except for tools like PySpy) is broken.
I'll deprecate Py_TPFLAGS_INLINE_VALUES instead of removing it, and add a "what's new" entry.

@Fidget-Spinner
Copy link
Member

Yeah I realised their usage is wrong. Don't think it's even safe to unset the flag after it's been set.

@encukou
Copy link
Member

encukou commented Jan 10, 2025

How do you check whether a type uses this layout (as in JPype)?

The code in JPype is a workaround for earlier breakage. Is there a clean way to do what they need?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants