Skip to content

Specialization of member descriptors only handles Py_T_OBJECT_EX but _Py_T_OBJECT seems more common #111772

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

Closed
markshannon opened this issue Nov 6, 2023 · 0 comments
Labels
performance Performance or resource usage

Comments

@markshannon
Copy link
Member

markshannon commented Nov 6, 2023

Despite _Py_T_OBJECT being marked as deprecated in descrobject.h it is commonly used in the standard library.
LOAD_ATTR_SLOT de-optimizes if the stored value is NULL. If the stored value is not NULL, both _Py_T_OBJECT and Py_T_OBJECT_EX act the same, so we can reuse LOAD_ATTR_SLOT for _Py_T_OBJECT.

For storing attributes, _Py_T_OBJECT and Py_T_OBJECT_EX are exactly the same.

I don't know why _Py_T_OBJECT is deprecated, the semantics seem quite reasonable.

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance or resource usage
Projects
None yet
Development

No branches or pull requests

1 participant