Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
gh-141004: DocumentPyBUF_WRITEABLE#141255
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
| ..c:macro:: PyBUF_WRITEABLE | ||
| This is a:term:`soft deprecated` alias to:c:macro:`PyBUF_WRITABLE`. |
StanFromIrelandNov 8, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| ..c:macro:: PyBUF_WRITEABLE | |
| This is a:term:`soft deprecated` alias to:c:macro:`PyBUF_WRITABLE`. | |
| ..c:namespace::NULL | |
| ..c:macro:: PyBUF_WRITEABLE | |
| This is a:term:`soft deprecated` alias to:c:macro:`PyBUF_WRITABLE`. |
I see this was recently done for a different alias, i.e., it is put under what it is aliased to:
Lines 196 to 205 inbe1c72a
| .. c:namespace:: NULL | |
| .. c:function:: long PyLong_AS_LONG(PyObject *obj) | |
| A:term:`soft deprecated` alias. | |
| Exactly equivalent to the preferred ``PyLong_AsLong``. In particular, | |
| it can fail with:exc:`OverflowError` or another exception. | |
| ..deprecated::3.14 | |
| The function is soft deprecated. |
IMO it also makes sense to add a.. deprecated:: 3.15.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I really don't think we should be backporting deprecations. It implies that it's valid to use up until that version, which we don't want people to think.
In general, it's very uncommon to backport deprecations. This is the second time someone has pointed to that as precedent, but I would have disagreed there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I removed it from the suggestion, but why not keep it here and just edit Miss Islington's backports to remove it? I volunteer to do it if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We need C API WG approval in order to do a deprecation, and that can take months. I'd like to do deprecations after we've gotten everything documented so we're not blocked by them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Also, what does.. c:namespace:: NULL do? I don't see a difference in the output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Also, what does
.. c:namespace:: NULLdo? I don't see a difference in the output.
It allows for cross referencing as the macro name IIUC,per the docs:
Using NULL ... as the scope will change to global scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Huh, I don't follow. This should be in the global namespace already. I think that only applies if you're using something likenamespace-push, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I simply copied what Petr had done, I've not tested it yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Testing it, it is not in the global namespace, and I need to use:c:macro:`PyBUF_WRITABLE.PyBUF_WRITEABLE`to get a link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hmm... I just tested it too, using:c:macro:`PyBUF_WRITEABLE` works just fine on my end.
StanFromIreland left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM, I don't feel strongly about the indentation.
5e5fc04 intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Thanks@ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
(cherry picked from commit5e5fc04)Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
GH-141260 is a backport of this pull request to the3.13 branch. |
(cherry picked from commit5e5fc04)Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
GH-141261 is a backport of this pull request to the3.14 branch. |
Uh oh!
There was an error while loading.Please reload this page.
📚 Documentation preview 📚:https://cpython-previews--141255.org.readthedocs.build/en/141255/c-api/buffer.html#c.PyBUF_WRITEABLE