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 Py_TPFLAGS_HAVE_FINALIZE macro #125447

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

Remove Py_TPFLAGS_HAVE_FINALIZE macro #125447

rruuaanng opened this issue Oct 14, 2024 · 6 comments
Labels
topic-C-API type-feature A feature request or enhancement

Comments

@rruuaanng
Copy link

rruuaanng commented Oct 14, 2024

Feature or enhancement

Proposal:

In https://github.com/python/cpython/blob/main/Doc/deprecations/c-api-pending-removal-in-future.rst, Many of these goals have been achieved, and this one doesn't seem to have been removed.

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

cc @vstinner here as well (we could however remove the usage in the project itself and its only non-test usage is in posixmodule.c, but we should not remove it from the headers)

Related: #86913 (comment)

The bit cannot be repurposed, since older extensions using the stable ABI might set it.
It doesn't make much sense to remove the Py_TPFLAGS_HAVE_VERSION_TAG or Py_TPFLAGS_HAVE_FINALIZE defines; I'd let them stay to document that the bits are reserved.

@rruuaanng
Copy link
Author

I agree with keeping it in the header file. But I think it is necessary to remove its use in the code base.

@vstinner
Copy link
Member

If you want to remove such constant, you should start by deprecating, and help projects to stop using it.

A code search in PyPI top 7,500 projects found that 6 projects are using it:

  • Cython (3.0.9)
  • Nuitka (2.1.2)
  • catboost (1.2.3)
  • cffi (1.16.0)
  • gevent (24.2.1)
  • orjson (3.9.15)

Check how these projects use the constant.

@rruuaanng
Copy link
Author

It seems that the projects used for use are limited. I'll go to the classifier of these projects to solve these problems.

@da-woods
Copy link
Contributor

da-woods commented Oct 14, 2024

Why is there any kind of urgency with this? Why not follow the normal process and announce an actual version well in advance and then wait until then?

Ultimately this is just an extra unused numeric constant that's hanging around so isn't doing any immediate harm.

Cython still supports Python 3.7 for the moment so does use the constant for that version. I'm sure we could work around the removal. But I'm not sure it's the best use of our time to have to respond to a sudden, unannounced and unnecessary removal.

@picnixz picnixz added the pending The issue will be closed if no feedback is provided label Oct 14, 2024
@vstinner
Copy link
Member

There is no urgency. I suggest to close this issue.

@erlend-aasland erlend-aasland closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2024
@erlend-aasland erlend-aasland removed the pending The issue will be closed if no feedback is provided label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-C-API type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

6 participants