-
Notifications
You must be signed in to change notification settings - Fork 6
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
Py_SIZE is not useful #10
Comments
I would say that it is worse than not useful, it is a trap. |
Are there better existing APIs with a well defined behavior? Py_SIZE() has flaws but can be used correctly if you know the type and so what the result means. If it's bad, we need a migration path. |
APIs for what? There's nothing to read the size of a variable-sized instance in general. That could be useful (but might not be cheap to store). |
Is this issue then simply "let's deprecate Py_SIZE"? |
That a possible solution. |
The meaning of a type's
Py_SIZE
(ob_size
) depends entirely on the type. The interpreter generally sets it on allocation, but can't rely on the value afterwards.Py_SIZE
is not different from other instance data and doesn't really need special treatmentPyVarObject
instanceThe text was updated successfully, but these errors were encountered: