Skip to content

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

Merged
merged 9 commits into from
Feb 23, 2019

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Feb 17, 2019

@pablogsal pablogsal requested a review from pitrou February 17, 2019 20:35

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.
Copy link
Member

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.

Copy link
Member Author

@pablogsal pablogsal Feb 18, 2019

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. :)

Copy link
Member

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).

Copy link
Member

@vstinner vstinner left a 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 :-)


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.
Copy link
Member

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).

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

Copy link
Member

@pitrou pitrou left a 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.

@pablogsal
Copy link
Member Author

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@vstinner: please review the changes made to this pull request.

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nascheme
Copy link
Member

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.

@methane methane merged commit 175421b into python:master Feb 23, 2019
@pablogsal pablogsal deleted the generations branch February 23, 2019 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants