Skip to content
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

Remove PyUnicode_READY in unicodeobject.h #125449

Closed
rruuaanng opened this issue Oct 14, 2024 · 4 comments
Closed

Remove PyUnicode_READY in unicodeobject.h #125449

rruuaanng opened this issue Oct 14, 2024 · 4 comments
Labels
type-feature A feature request or enhancement

Comments

@rruuaanng
Copy link
Contributor

rruuaanng commented Oct 14, 2024

Feature or enhancement

Proposal:

# Add a code block here, if required

In https://github.com/python/cpython/blob/main/Doc/deprecations/c-api-pending-removal-in-future.rst.

PyUnicode_READY Unneeded since Python 3.12.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

@rruuaanng rruuaanng added the type-feature A feature request or enhancement label Oct 14, 2024
@picnixz
Copy link
Contributor

picnixz commented Oct 14, 2024

Unless there is a real need to remove public macros/functions, even if they are useless, we usually don't do it. We don't want to un-necessarily break code that are still using them (the maintenance cost does not seem that hard).

cc @vstinner

@rruuaanng
Copy link
Contributor Author

rruuaanng commented Oct 14, 2024

As far as I investigated. In the master branch, there is no file using it.

Edit:
In addition, it is clearly stated in https://github.com/python/cpython/blob/main/Doc/deprecations/c-api-pending-removal-in-future.rst that this API is to be removed. Therefore, other external libraries that use this function should make changes (the document states that this API is only for backward compatibility, but in fact no one in the code base uses it).

@picnixz
Copy link
Contributor

picnixz commented Oct 14, 2024

Yes, but what about external code? it's located in a header, so anyone can include them. The pending removal section has no planned removal date so unless there is a real need to remove it, we should first plan when it should be removed.

@vstinner
Copy link
Member

Please keep this function. I suggest to close the issue.

A code search on PyUnicode_READY in PyPI top 7,500 projects found 133 matching lines in 43 projects.

@picnixz picnixz closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants