Skip to content

gh-107149: Rename PyUnstable_ExecutableKinds to _Py_ExecutableKinds #108651

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

Closed
wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Aug 29, 2023

Rename contants, replace Py with _Py (add underscore prefix):

  • PY_EXECUTABLE_KIND_SKIP = > _PY_EXECUTABLE_KIND_SKIP
  • PY_EXECUTABLE_KIND_PY_FUNCTION => _PY_EXECUTABLE_KIND_PY_FUNCTION
  • PY_EXECUTABLE_KIND_BUILTIN_FUNCTION => _PY_EXECUTABLE_KIND_BUILTIN_FUNCTION
  • PY_EXECUTABLE_KIND_METHOD_DESCRIPTOR => _PY_EXECUTABLE_KIND_METHOD_DESCRIPTOR
  • PY_EXECUTABLE_KINDS => _PY_EXECUTABLE_KINDS

@gvanrossum
Copy link
Member

Please hold off at least until we've had a change to discuss this with @markshannon. I expect see him tomorrow.

…inds

Rename contants, replace Py with _Py (add underscore prefix):

* PY_EXECUTABLE_KIND_SKIP = > _PY_EXECUTABLE_KIND_SKIP
* PY_EXECUTABLE_KIND_PY_FUNCTION => _PY_EXECUTABLE_KIND_PY_FUNCTION
* PY_EXECUTABLE_KIND_BUILTIN_FUNCTION =>
  _PY_EXECUTABLE_KIND_BUILTIN_FUNCTION
* PY_EXECUTABLE_KIND_METHOD_DESCRIPTOR =>
  _PY_EXECUTABLE_KIND_METHOD_DESCRIPTOR
* PY_EXECUTABLE_KINDS => _PY_EXECUTABLE_KINDS
@vstinner vstinner force-pushed the rename_executable_kinds branch from 07af9da to bbb0c48 Compare August 30, 2023 03:15
@vstinner
Copy link
Member Author

docs/readthedocs.org:cpython-previews — Read the Docs build failed!

Error:

There was a problem with Read the Docs while building your documentation. Please try again later. If this problem persists, report this error to us with your build id (21758601).

I rebased my PR on the main branch to re-trigger CI jobs.

@markshannon
Copy link
Member

markshannon commented Aug 30, 2023

These constants are intended for tools like pyspy and austin, which are out-of-process tools.
They need to copy and paste the constants, so it doesn't matter to them whether they are private or unstable.
However, they could be useful for in-process tools as well, so making them "unstable" seems best.

Presumably that means moving them to Include/cpython/pyframe.h and giving them a PY_UNSTABLE prefix.

Generally, I think we shouldn't be adding private (ie. _PY_) constants to (semi-)public headers, unless we really can't avoid it.

@vstinner
Copy link
Member Author

Presumably that means moving them to Include/cpython/pyframe.h and giving them a PY_UNSTABLE prefix.

Oh, I already wrote PR #108440 for that, the alternative option :-)

@vstinner
Copy link
Member Author

@markshannon prefers to add this API to the public C API, so I close this PR. See PR #108440 instead.

@vstinner vstinner closed this Aug 30, 2023
@vstinner vstinner deleted the rename_executable_kinds branch August 31, 2023 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants