-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-36016: Allow gc.getobjects to return the objects in a specific generation #11909
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
Doc/library/gc.rst
Outdated
|
||
Returns a list of all objects tracked by the collector, excluding the list | ||
returned. | ||
|
||
.. versionchanged:: 3.8 | ||
If generation is not None, return only the objects tracked by the | ||
collector that are in that generation. |
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.
Document about option in function document, and simplify this.
And use versionadded
instead.
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.
@methane Done in 1294e7d
I am not sure what do you have in mind for the versionadded
section. Please, check that what was done in 1294e7d makes sense. :)
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.
And use
versionadded
instead.
IMHO versionadded should be reserved to new functions/constants (ex: posix_spawn added to Python 3.8).
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 like this feature :-)
Doc/library/gc.rst
Outdated
|
||
Returns a list of all objects tracked by the collector, excluding the list | ||
returned. | ||
|
||
.. versionchanged:: 3.8 | ||
If generation is not None, return only the objects tracked by the | ||
collector that are in that generation. |
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.
And use
versionadded
instead.
IMHO versionadded should be reserved to new functions/constants (ex: posix_spawn added to Python 3.8).
When you're done making the requested changes, leave the 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.
Looks like a worthwhile addition to me. Some comments below.
I have made the requested changes; please review again |
Thanks for making the requested changes! @vstinner: please review the changes made to this pull request. |
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
Co-Authored-By: pablogsal <[email protected]>
Co-Authored-By: pablogsal <[email protected]>
I didn't review the code closely but adding this functionality seems like an okay idea. It is relatively easy to implement and provides a more detailed view into what the GC is doing. |
https://bugs.python.org/issue36016