-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-15088 : Remove PyGen_NeedsFinalizing() #15702
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
Conversation
Well, it makes no sense to make it internal if it's not used internally. I see two possible resolutions:
|
My searches show references to this function in CPython cloned repositories. From your views, I think it is better to deprecate it with a removal notice for a later release. |
I have deprecated the Function instead and will be removed in the next release. |
IMHO it's not worth it to have a deprecation period, since the function is not documented, not tested and I cannot find any project using it. See my rationale: This function really looks like an internal function which leaked to the C API by mistake. I propose to remove it immediately. What do you think @pitrou? @pitrou wrote:
Since I understand that he is fine with removing it. We just have to document clearly its removal at: https://docs.python.org/dev/whatsnew/3.9.html#build-and-c-api-changes |
Appveyor is giving me a red with a result I don't understand to resolve i.e "Tests result: ENV CHANGED" @vstinner ideas? |
If it's not being used anywhere else, I think it's safe to remove it. Having a deprecation period adds additional maintenance. From my understanding, our general practice has been that anything which is not documented is not guaranteed to be part of the public API. |
No opposition from me, though I generally find it nicer to at least leave it deprecated for one version (you never know what non-public code may do). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @nanjekyejoannah.
From what I can tell, AppVeyor seems to be failing with ENV_CHANGED
due to
1 test altered the execution environment: test_asyncio
Upon further inspection, it looks like env changed
occurred only on line 1094 of the build log:
[00:09:54] 0:03:38 load avg: 5.63 [224/419/1] test_asyncio failed (env changed) (1 min 18 sec) -- running: test_multiprocessing_spawn (1 min 48 sec)
I'm not certain as to the cause though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend some minor modifications to the Misc/NEWS and What's New entries.
Current:
The C function ``PyGen_NeedsFinalizing`` has been removed. It was not
documented, tested or even used anywhere in the code base after
PEP 442 implementation made it useless.
(Patch by Joannah Nanjekye)
Suggested:
The C function ``PyGen_NeedsFinalizing`` has been removed. It was not
documented, tested or used anywhere within CPython after the implementation
of :pep:`442`. Patch by Joannah Nanjekye.
I adjusted the phrasing, made the entry more succinct, and made a few formatting changes. Most notably, I condensed the lines so they could fit the maximum number of words on each line (within the 80 char width limit of reST) and added Sphinx markup for PEP 442 to provide an external link for readers.
My worry is that nobody pays attention to compiler warnings. I'm not sure that mentioning the deprecation in the documentation would be enough to notify potential users that it's deprecated. Outside Python internals, I don't see why anyone would need this function? PyGenObject structure is currently exposed, so it's possible to copy/paste this function in a closed source project if needed. It's short:
If we remove the function at the beginning of the 3.9 dev cycle, I also hope that enough users will test Python 3.8 beta versions, to check if they still compile without PyGen_NeedsFinalizing :-) |
It's a random falure. If you make a change to your PR, a new CI job will be run and it will be fine (I hope). I reported this asyncio bug more than one year ago. I even wrote a fix: But my fix has been reverted: Does anyone want to make changes requested by @1st1? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@nanjekyejoannah: I let you modify the documentation according to @aeros167 suggestion, and then I plan to merge your change. |
Thanks, @aeros167 for suggestions I have made the requested changes. @vstinner PTAL. |
I merged your PR @nanjekyejoannah, thanks. If anyone uses it, please complain before Python 3.9.0 release :-) |
Remove PyGen_NeedsFinalizing(): it was not documented, tested or used anywhere within CPython after the implementation of PEP 442.
Remove PyGen_NeedsFinalizing(): it was not documented, tested or used anywhere within CPython after the implementation of PEP 442.
Remove PyGen_NeedsFinalizing(): it was not documented, tested or used anywhere within CPython after the implementation of PEP 442.
I made
PyGen_NeedsFinalizing()
internal instead of deleting the logic all together much as the function is not called anywhere in the codebase. Should I have done the later? @vstinner @pitrouEdit: We decided to remove it all together.
https://bugs.python.org/issue15088