-
-
Notifications
You must be signed in to change notification settings - Fork 32k
PyMemoryView_FromMemory is part of stable ABI but the flag constants (PyBUF_READ, etc.) are not #98680
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
Comments
These were available in 3.11.0 with Py_LIMITED_API defined for 3.11, and are necessary to use the API. They should be considered part of the 3.11 Limited API.
How did you get this error? The flags should be available with It's true that they weren't added to the manifest, though. Thanks for catching that! |
These were available in 3.11.0 with Py_LIMITED_API defined for 3.11, and are necessary to use the API. They should be considered part of the 3.11 Limited API.
anything older than 3.11 has: #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
PyAPI_FUNC(PyObject *) PyMemoryView_FromMemory(char *mem, Py_ssize_t size,
int flags);
#endif |
Ah! Of course. 3.11 added the whole buffer API and I somehow assumed If we add the constants retroactively, code that compiles fine on newer Python versions might fail to compile on older ones, even with the same |
yeah I totally understand -- my bad for not checking 3.11 otherwise this would have been more accurately just a documentation issue /o\ |
``PyBUF_*`` constants are marked as part of Limited API of Python 3.11+. These were available in 3.11.0 with `Py_LIMITED_API` defined for 3.11, and are necessary to use the buffer API. Omitting them in `stable_abi.toml` was a mistake.
…honGH-100018) ``PyBUF_*`` constants are marked as part of Limited API of Python 3.11+. These were available in 3.11.0 with `Py_LIMITED_API` defined for 3.11, and are necessary to use the buffer API. Omitting them in `stable_abi.toml` was a mistake. (cherry picked from commit f247387) Co-authored-by: Petr Viktorin <[email protected]>
``PyBUF_*`` constants are marked as part of Limited API of Python 3.11+. These were available in 3.11.0 with `Py_LIMITED_API` defined for 3.11, and are necessary to use the buffer API. Omitting them in `stable_abi.toml` was a mistake. (cherry picked from commit f247387) Co-authored-by: Petr Viktorin <[email protected]>
Don't feel bad at all -- an issue that's not fully triaged is better than no issue :) |
Feature or enhancement
I'd rather not write:
and instead be able to rely on these even in stable abi mode
relevant error message:
Linked PRs
The text was updated successfully, but these errors were encountered: