-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
bpo-40170: Hide implementation detail of Py_TRASHCAN_BEGIN macro #23235
Conversation
cc @vstinner |
Doc/whatsnew/3.10.rst
Outdated
* The ``Py_TRASHCAN_BEGIN`` macro no longer accesses PyTypeObject attributes, | ||
but now can get the condition by calling the new private | ||
:c:func:`_PyTrash_cond()` function which hides implementation details. | ||
(Contributed by Hai Shi in :issue:`40170`.) |
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 don't think that it's worth it to mention in What's New in Python 3.10. End users will not notice and don't care ;-)
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.
Ok, removed.
I decided add this news because I saw you have written the description info of _PyTrash_begin()
and _PyTrash_end()
in whatsnew. Lol~
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 wrote a changelog entry, but nothing in What's New in Python 3.9 or What's New in Python 3.10, no?
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.
Oh, I saw this info in https://github.com/python/cpython/blob/master/Misc/NEWS.d/3.9.0a5.rst.
Looks like I confused the news file with relese file : (, sorry.
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.
No problem.
I consider that "What's New in Python X.Y" should be short and only describe the public API, but the Changelog should describe every single change and private functions can be mentioned there.
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.
Oh, This great. I am very confused when I start write the whatsnew file in the first time.
It's more like a double copy operation.
In fact, I don't know how release manager to archieve those change log.
My simple thought: Maybe we can create some labels to tag what's info should be added in release file or not. When release manager archive those change log, those taged changeinfo chould be archieved in release file automatically.
If this thought have any value, I can add this in my TODO list. Lol~
@vstinner Hi, victor. Is this PR good enough to be merged? |
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, but please address my last minor request (just add a comment).
@@ -2134,6 +2134,13 @@ _PyTrash_end(PyThreadState *tstate) | |||
} | |||
|
|||
|
|||
int |
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.
Please add comment explaining that it is used by the Py_TRASHCAN_BEGIN macro.
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.
Got it, updated.
Merged, thanks. |
Thanks, victor. |
The Py_TRASHCAN_BEGIN macro no longer accesses PyTypeObject attributes, but now can get the condition by calling the new private _PyTrash_cond() function which hides implementation details.
https://bugs.python.org/issue40170