Skip to content

C API: Rename _PyUnstable_GetUnaryIntrinsicName() to PyUnstable_GetUnaryIntrinsicName()? #107149

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
vstinner opened this issue Jul 23, 2023 · 9 comments
Labels
topic-C-API type-bug An unexpected behavior, bug, or error

Comments

@vstinner
Copy link
Member

vstinner commented Jul 23, 2023

Python 3.13 added _PyUnstable_GetUnaryIntrinsicName() and _PyUnstable_GetBinaryIntrinsicName() to the C API. I don't get the _PyUnstable prefix: PEP 689 – Unstable C API tier uses PyUnstable_ prefix.

Is it just a typo, or is the API private on purpose? If it's private, why does its name look like as if it's part of the Unstable C API?

cc @brandtbucher @iritkatriel @encukou

Linked PRs

@vstinner vstinner added type-bug An unexpected behavior, bug, or error topic-C-API labels Jul 23, 2023
vstinner added a commit to vstinner/cpython that referenced this issue Aug 24, 2023
Move PyUnstable_ExecutableKinds and associated macros from the
internal C API to the public C API.
vstinner added a commit to vstinner/cpython that referenced this issue Aug 24, 2023
Move PyUnstable_ExecutableKinds and associated macros from the
internal C API to the public C API.
vstinner added a commit to vstinner/cpython that referenced this issue Aug 24, 2023
* Rename _PyUnstable_GetUnaryIntrinsicName() to
  PyUnstable_GetUnaryIntrinsicName()
* Rename _PyUnstable_GetBinaryIntrinsicName()
  to PyUnstable_GetBinaryIntrinsicName().
@iritkatriel
Copy link
Member

I doubt there was a reason for the _. Probably just a habit.

vstinner added a commit that referenced this issue Aug 28, 2023
* Rename _PyUnstable_GetUnaryIntrinsicName() to
  PyUnstable_GetUnaryIntrinsicName()
* Rename _PyUnstable_GetBinaryIntrinsicName()
  to PyUnstable_GetBinaryIntrinsicName().
vstinner added a commit to vstinner/cpython that referenced this issue Aug 29, 2023
Move PyUnstable_ExecutableKinds and associated macros from the
internal C API to the public C API.
vstinner added a commit to vstinner/cpython that referenced this issue Aug 29, 2023
…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 added a commit to vstinner/cpython that referenced this issue Aug 30, 2023
…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 added a commit to vstinner/cpython that referenced this issue Aug 30, 2023
Move PyUnstable_ExecutableKinds and associated macros from the
internal C API to the public C API.

Rename constants: replace "PY_" prefix with "PyUnstable_" prefix.
vstinner added a commit that referenced this issue Aug 31, 2023
Move PyUnstable_ExecutableKinds and associated macros from the
internal C API to the public C API.

Rename constants: replace "PY_" prefix with "PyUnstable_" prefix.
@vstinner
Copy link
Member Author

At the end, all APIs discussed here are public and exposed with the PyUnstable prefix in the public C API (in Include/cpython/).

@encukou
Copy link
Member

encukou commented Aug 31, 2023

Unstable API needs documentation and tests.

@encukou encukou reopened this Aug 31, 2023
@erlend-aasland
Copy link
Contributor

Unstable API needs documentation and tests.

Perhaps #105481 (which added the APIs in question) should be reopened instead.

@vstinner
Copy link
Member Author

vstinner commented Nov 8, 2023

@erlend-aasland:

Perhaps #105481 (which added the APIs in question) should be reopened instead.

Ok, I closed this issue and reopened gh-105481 instead.

@vstinner vstinner closed this as completed Nov 8, 2023
@iritkatriel
Copy link
Member

@erlend-aasland:

Perhaps #105481 (which added the APIs in question) should be reopened instead.

Ok, I closed this issue and reopened gh-105481 instead.

It's not easy to see on that issue what you mean (which unstable APIs? That issue contained several large PRs that change many things). I think it actually works better to finish it off on this issue or create a new one than to report a large old issue.

@iritkatriel
Copy link
Member

Also, PyUnstable_ExecutableKinds was not added in #105481.

@iritkatriel
Copy link
Member

Reopening. See #105481 (comment).

@vstinner
Copy link
Member Author

Reopening. See #105481 (comment).

Change implemented by 36aab34. I close again the issue.

aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-C-API type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants