Skip to content

Conversation

@ZeroIntensity
Copy link
Member

@ZeroIntensity ZeroIntensity commented Nov 8, 2025

Comment on lines +264 to +266
.. c:macro:: PyBUF_WRITEABLE
This is a :term:`soft deprecated` alias to :c:macro:`PyBUF_WRITABLE`.
Copy link
Member

@StanFromIreland StanFromIreland Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. 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:

cpython/Doc/c-api/long.rst

Lines 196 to 205 in be1c72a

.. 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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

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.

It allows for cross referencing as the macro name IIUC, per the docs:

Using NULL ... as the scope will change to global scope.

Copy link
Member Author

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 like namespace-push, right?

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

@StanFromIreland StanFromIreland left a 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.

@ZeroIntensity ZeroIntensity merged commit 5e5fc04 into python:main Nov 8, 2025
35 checks passed
@ZeroIntensity ZeroIntensity deleted the document-pybuf-writeable branch November 8, 2025 17:29
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Nov 8, 2025
@ZeroIntensity ZeroIntensity added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Nov 8, 2025
@miss-islington-app
Copy link

Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington-app
Copy link

Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 8, 2025
(cherry picked from commit 5e5fc04)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Nov 8, 2025

GH-141260 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 8, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 8, 2025
(cherry picked from commit 5e5fc04)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Nov 8, 2025

GH-141261 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Nov 8, 2025
ZeroIntensity added a commit that referenced this pull request Nov 8, 2025
gh-141004: Document `PyBUF_WRITEABLE` (GH-141255)
(cherry picked from commit 5e5fc04)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
ZeroIntensity added a commit that referenced this pull request Nov 8, 2025
gh-141004: Document `PyBUF_WRITEABLE` (GH-141255)
(cherry picked from commit 5e5fc04)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants