Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
bpo-40170: Convert PyObject_IS_GC() macro to a function#19464
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
shihai1991 commented Apr 10, 2020 • edited by bedevere-bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-bot
Uh oh!
There was an error while loading. Please reload this page.
Fix typo of news
pablogsal commented Apr 11, 2020
@shihai1991 Could you rebase the PR to pick the latest changes? |
shihai1991 commented Apr 11, 2020
Got it, done ;) |
pablogsal left a comment
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.
Hummmm, I think we still need a macro version for internal use for performance reasons. @vstinner was that your original intent?
bedevere-bot commented Apr 11, 2020
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
vstinner commented Apr 13, 2020
Right, please add a static inline function _PyObject_IS_GC() in pycore_object.h and modify gcmodule.c to use it (replace PyObject_IS_GC with _PyObject_IS_GC). PyObject_IS_GC() function body should just call _PyObject_IS_GC(). |
shihai1991 commented Apr 13, 2020
I have made the requested changes; please review again |
bedevere-bot commented Apr 13, 2020
Thanks for making the requested changes! @pablogsal: please review the changes made to this pull request. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Include/cpython/objimpl.h Outdated
| if (PyType_IS_GC(Py_TYPE(obj))){ | ||
| return (Py_TYPE(obj)->tp_is_gc==NULL||Py_TYPE(obj)->tp_is_gc(obj)); | ||
| } | ||
| return0; |
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.
| if (PyType_IS_GC(Py_TYPE(obj))){ | |
| return (Py_TYPE(obj)->tp_is_gc==NULL||Py_TYPE(obj)->tp_is_gc(obj)); | |
| } | |
| return0; | |
| return (PyType_IS_GC(Py_TYPE(obj)) | |
| && (Py_TYPE(obj)->tp_is_gc==NULL | |
| ||Py_TYPE(obj)->tp_is_gc(obj))); |
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.
this code style looks more simple?
Uh oh!
There was an error while loading. Please reload this page.
Co-Authored-By: Victor Stinner <vstinner@python.org>
Co-Authored-By: Victor Stinner <vstinner@python.org>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
vstinner commented Apr 14, 2020
Thanks @shihai1991! |
shihai1991 commented Apr 15, 2020
Thanks, folks. I learned much in this PR(especially in docs(what is user really need). |
https://bugs.python.org/issue40170