Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-36016: Allow gc.getobjects to return the objects in a specific generation#11909

Merged
methane merged 9 commits into
python:masterpython/cpython:masterfrom
pablogsal:generationspablogsal/cpython:generationsCopy head branch name to clipboard
Feb 23, 2019
Merged

bpo-36016: Allow gc.getobjects to return the objects in a specific generation#11909
methane merged 9 commits into
python:masterpython/cpython:masterfrom
pablogsal:generationspablogsal/cpython:generationsCopy head branch name to clipboard

Conversation

@pablogsal

@pablogsal pablogsal commented Feb 17, 2019

Copy link
Copy Markdown
Member

@pablogsal pablogsal requested a review from pitrou February 17, 2019 20:35
Comment thread Lib/test/test_gc.py
Comment thread Doc/library/gc.rst Outdated

.. versionchanged:: 3.8
If generation is not None, return only the objects tracked by the
collector that are in that generation.

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

@pablogsal pablogsal Feb 18, 2019

Copy link
Copy Markdown
Member Author

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

Comment thread Modules/gcmodule.c Outdated

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like this feature :-)

Comment thread Doc/library/gc.rst Outdated
Comment thread Doc/library/gc.rst Outdated

.. versionchanged:: 3.8
If generation is not None, return only the objects tracked by the
collector that are in that generation.

Copy link
Copy Markdown
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).

Comment thread Doc/whatsnew/3.8.rst Outdated
Comment thread Modules/gcmodule.c Outdated
Comment thread Lib/test/test_gc.py Outdated
@bedevere-bot

Copy link
Copy Markdown

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

@pitrou pitrou left a comment

Copy link
Copy Markdown
Member

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.

Comment thread Lib/test/test_gc.py Outdated
Comment thread Lib/test/test_gc.py Outdated
Comment thread Modules/gcmodule.c Outdated
@pablogsal

Copy link
Copy Markdown
Member Author

I have made the requested changes; please review again

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

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

@pitrou pitrou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Comment thread Doc/whatsnew/3.8.rst
Comment thread Lib/test/test_gc.py Outdated
Comment thread Modules/gcmodule.c Outdated
Comment thread Modules/gcmodule.c
Comment thread Modules/gcmodule.c Outdated
vstinner and others added 3 commits February 18, 2019 23:38
Co-Authored-By: pablogsal <Pablogsal@gmail.com>
Co-Authored-By: pablogsal <Pablogsal@gmail.com>
@nascheme

Copy link
Copy Markdown
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.