-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Open
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
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.
Linked PRs
emmatyping
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-featureA feature request or enhancementA feature request or enhancement