You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose Py_SIZE, Py_IS_TYPE, Py_SET_SIZE as functions in the Stable ABI #139165
Py_SIZE & Py_SET_SIZE have issues -- I wish ob_size was much less public than it is -- but they can be used correctly and don't currently have good alternatives for some use cases.
Also, they're available as static inline functions when Py_LIMITED_API is defined, so many people treat them as part of Limited API already. The same goes for Py_IS_TYPE.
Let's turn them into real function symbols, and keep the static inline variants in the non-Limited API only.
Note that I don't propose exposing Py_SET_TYPE this way. The proper way to change an object's type is setting the __class__ Python attribute, which does proper checks and reference counting.
Activity
gh-139165: Make Py_SIZE, Py_IS_TYPE,Py_ SET_SIZE regular functions in…
pythongh-139165: Make Py_SIZE, Py_IS_TYPE,Py_ SET_SIZE regular functi…
pythongh-139165: Make Py_SIZE, Py_IS_TYPE,Py_ SET_SIZE regular functi…